-
Notifications
You must be signed in to change notification settings - Fork 175
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
[CHORE] Refactor logging #1489
[CHORE] Refactor logging #1489
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1489 +/- ##
=========================================
+ Coverage 0 74.87% +74.87%
=========================================
Files 0 59 +59
Lines 0 6106 +6106
=========================================
+ Hits 0 4572 +4572
- Misses 0 1534 +1534
|
@jaychia I think this makes sense, but we should still be capturing logs somehow. I dont think we need to do a handler to stdout but having a log handler that writes our INFO logs to a file would be really helpful. Take a look on what ray did. They write to |
To prevent files from getting too big, ray also does log rotation. Let me know what you think, also cool to do in a follow up |
Yes so by default all of our logs will already go to stderr (because Python logs on stderr by default I believe) In addition to that behavior, I can add some Daft env vars to log Daft logs into a file in |
loguru
as a dependencyI did (3) because Daft is a library, and custom formatting of logs should be done by the application. E.g. if a user was building a webserver with their own custom logging setup, then Daft mangling log formatting on the root logger would be very annoying.
This is what our logs look like now on a jupyter notebook:
Enabling more verbose logs at a higher level (e.g. INFO logs) is performed by the user/embedding that uses Daft, e.g.
Daft now respects normal Python logging and does not rely on loguru at all to do any of this configurations. This lets us play much nicer with applications that use normal Python logging.