-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC: Base logging #24490
RFC: Base logging #24490
Commits on Dec 15, 2017
-
Copy of MicroLogging core.jl (897172e) -> logging.jl
This is a straight copy - not useful by itself, but as a reference point for porting further changes.
Configuration menu - View commit details
-
Copy full SHA for ec3920d - Browse repository at this point
Copy the full SHA ec3920dView commit details -
Logging updates required for Base porting effort
* Remove 0.6 compatibility junk * Ensure logging macros can be used earlier in Base * Remove unnecessary types from core logging method defaults * max_log -> maxlog for log limiting * Beef up SimpleLogger a little to avoid temporary buffer async issues, respect maxlog, and make log colorization more consistent. It can be re-simplified again once there's a viable alternative in stdlib Logging. * Hash entire expression for log event ids. This makes ids more likely to be unique before deduplication, which makes them more likely to be stable.
Configuration menu - View commit details
-
Copy full SHA for dfcfb27 - Browse repository at this point
Copy the full SHA dfcfb27View commit details -
Configuration menu - View commit details
-
Copy full SHA for 332c05e - Browse repository at this point
Copy the full SHA 332c05eView commit details -
Move logger state to explicitly reside in Task
This seems to be the simplest way to tackle two problems: * Tasks should inherit the logger state from the parent task. If not, all new tasks will use the global logger, which is unlikely to be what you want. In particular, the use of `@ async` in `Pkg` means we need something along these lines. * The cost of looking up the current log level in the Task local state dictionary is expensive when we want to discard a lot of potential Debug messages as quickly as possible.
Configuration menu - View commit details
-
Copy full SHA for 4614dae - Browse repository at this point
Copy the full SHA 4614daeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f57595 - Browse repository at this point
Copy the full SHA 2f57595View commit details -
Configuration menu - View commit details
-
Copy full SHA for 524301f - Browse repository at this point
Copy the full SHA 524301fView commit details -
Migrate Base to logging macros
For messages this was a somewhat mechanical upgrade assisted by Deprecations.jl. Some messages are lightly edited for consistency: * Where exceptions were interpolated, they're instead added as keyword arguments: `exception=ex` * An attempt has been made to punctuate log messages consistently with the convention from pkg: Short messages start with a capital, but have no period. * In places where the log message is generated using logic, the logic is pulled inside the message generation block. (Good practise from a scoping and efficiency point of view.) Notes on other changes: * `warn_once()` use has been replaced with the annotation `maxlog=1`. This depends on the logging backend to honor it, but makes things much more flexible. * `warnbanner()` use has been replaced with markdown formatted versions of `@ warn` * Avoid use display_error outside of REPL, thereby removing the log_error_to dependency * A few uses of bare println() have been replaced with logging * depwarns go to the new system, and use the frame address as the key for a speedy first pass at deduplication. A full depwarn report can be created in the future by collecting the log records * Port all logging tests to use test_logs where possible rather than reading streams. * Exceptions caught while executing commands on the REPL always go to the REPL output stream rather than being logged to the current logger, under the premise that this feedback is "normal output" for the REPL. Areas for further improvement: * A few remaining tests still use test_warn, as they call separate julia processes where the log records aren't yet forwarded transparently. * Tests for deprecated functionality are disabled in depwarn=error mode. It would be better to remove depwarn=error and rely on a logger instead.
Configuration menu - View commit details
-
Copy full SHA for 7f434c0 - Browse repository at this point
Copy the full SHA 7f434c0View commit details -
Deprecate old logging info(), warn(), logging()
To capture messages from Base, users should install a logger instead, for example, using `with_logger()`.
8Configuration menu - View commit details
-
Copy full SHA for 5d77d1b - Browse repository at this point
Copy the full SHA 5d77d1bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1845bdb - Browse repository at this point
Copy the full SHA 1845bdbView commit details