mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Ensure logs are flushed
This ensures that anything written to the logs are synced as they happen. This also changes the error message of the libcontainer error. The original idea was to have this extra information in the message but it makes it hard to parse and if the caller needed this information they can just get it from the error type. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -100,7 +100,7 @@ func main() {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
if path := context.GlobalString("log"); path != "" {
|
||||
f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
|
||||
f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY|os.O_APPEND|os.O_SYNC, 0666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user