mirror of
https://github.com/v2ray/v2ray-core.git
synced 2024-04-21 12:31:52 +00:00
mconfig subcommand ready
This commit is contained in:
@@ -119,6 +119,15 @@ func CreateStdoutLogWriter() WriterCreator {
|
||||
}
|
||||
}
|
||||
|
||||
// CreateStderrLogWriter returns a LogWriterCreator that creates LogWriter for stderr.
|
||||
func CreateStderrLogWriter() WriterCreator {
|
||||
return func() Writer {
|
||||
return &consoleLogWriter{
|
||||
logger: log.New(os.Stderr, "", log.Ldate|log.Ltime),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CreateFileLogWriter returns a LogWriterCreator that creates LogWriter for the given file.
|
||||
func CreateFileLogWriter(path string) (WriterCreator, error) {
|
||||
file, err := os.OpenFile(path, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
|
||||
|
||||
@@ -39,6 +39,9 @@ func Run(args []string, input io.Reader) (buf.MultiBuffer, error) {
|
||||
}
|
||||
return nil, newError(msg).Base(err)
|
||||
}
|
||||
if !errBuffer.IsEmpty() {
|
||||
newError("v2ctl > ", errBuffer.String()).AtInfo().WriteToLog()
|
||||
}
|
||||
|
||||
return outBuffer.MultiBuffer, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user