Skip to content
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

Improve logging package #22

Closed
kevmoo opened this issue Jun 23, 2015 · 2 comments
Closed

Improve logging package #22

kevmoo opened this issue Jun 23, 2015 · 2 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@kevmoo
Copy link
Member

kevmoo commented Jun 23, 2015

From @jimbeveridge on June 16, 2015 16:36

I've been using logging to debug Mojo packages and there are some refinements that would be very helpful. These features (except 5) are all part of Google's standard C++ logging module, glog.

  1. Need a way to disambiguate log entries from a multi-isolate app. Getting the name of the current app is a challenge in Mojo, so the logging library can't do this automatically. Maybe make the app name an optional static member of the logging class?
  2. Add support for accepting a filter of one or more RegEx expression that enumerate logging levels on a per-name basis, similar to glog.
  3. It should be possible to globally set the log level across all isolates. Although this should be easy using environment variables, Mojo does not support dart:io, so that's problematic for Mojo apps. Maybe Mojo apps need to have a single source file that specifies the RegEx filter that all related Dart Mojo apps can include and pass to the logging package.
  4. Logs going to the console should be color coded (yellow for warn, red for severe.)
  5. Nice to have - log to an HTML window, including color support. The reason this is useful is that the HTML window can clear for each new run, making it much easier to see where new runs begin.

Copied from original issue: dart-lang/sdk#23653

@kevmoo
Copy link
Member Author

kevmoo commented Jun 23, 2015

From @sethladd on June 17, 2015 13:45

I think we should move this issue over to https://github.com/dart-lang/logging/issues

@pq pq added type-enhancement A request for a change that isn't a bug and removed type-enhancement A request for a change that isn't a bug labels Oct 27, 2018
@natebosch
Copy link
Member

  1. Need a way to disambiguate log entries from a multi-isolate app. Getting the name of the current app is a challenge in Mojo, so the logging library can't do this automatically. Maybe make the app name an optional static member of the logging class?

The log listener should be able to handle this. The app name information can be read from a global variable (or wherever you want to store it) before it emits the log to wherever it is going - whether that is stdout or some file, or if it's getting serialized across an isolate boundary.

  1. Add support for accepting a filter of one or more RegEx expression that enumerate logging levels on a per-name basis, similar to glog.

Do you mean per logger name? I'm really not sure how this would be used. You can set a level on each logger and you control the names. If someone can elaborate on this we can revisit.

  1. It should be possible to globally set the log level across all isolates. Although this should be easy using environment variables, Mojo does not support dart:io, so that's problematic for Mojo apps. Maybe Mojo apps need to have a single source file that specifies the RegEx filter that all related Dart Mojo apps can include and pass to the logging package.

Isolates are intentionally isolated. This seems like a problem at a much higher level than we can address in this package.

  1. Logs going to the console should be color coded (yellow for warn, red for severe.)
  2. Nice to have - log to an HTML window, including color support. The reason this is useful is that the HTML window can clear for each new run, making it much easier to see where new runs begin.

This is a concern for the log listener that is writing to the console. This isn't something related to this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants