-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
The global logger is set to an open socket in the main serverRun function. This causes issues if, for example, you are running DaemonMode as a background task in an interactive session. The pipe eventually closes and causes code to fail if it tries to log anything.
Wouldn't it be better to use the with_logger construct? It would be simple to implement:
with_logger(MinLevelLogger(FormatLogger(create_mylog(fname), sock), Logging.Info)) do
# same code as before
endI cannot write a test to reproduce the issue, as you have to wait for libuv to close the socket. There is an intermediate "paused" state that libuv appears to put sockets in when the server exits, and I haven't figured out how to put the socket in a "closed" state in a way that would reproduce the error.
Metadata
Metadata
Assignees
Labels
No labels