-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add flush api to default stdout/stderr logger #87
Conversation
motivation: default logger may not flush the streams on crush, so need to make flushing moe explicit changes: * add a constructor argument to control flushing behaviour, default to "everytime" * add a "flush" method to allow user defined flush timing. this api is now internal but we could expose it if there is a need * add tests
solved #86 |
Tests/LoggingTests/LoggingTest.swift
Outdated
var fds: [Int32] = [-1, -1] | ||
fds.withUnsafeMutableBufferPointer { ptr in | ||
let err = pipe(ptr.baseAddress!) | ||
assert(err == 0, "pipe: \(err)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it's in a test case, you can use XCTAssertEqual(0, err)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks great, some minor comments.
@weissi addressed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM
motivation: default logger may not flush the streams on crush, so need to make flushing moe explicit
changes: