-
Notifications
You must be signed in to change notification settings - Fork 24
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
log only certain levels #46
Comments
@Paul-Todd I believe you could do that with the existing API, since lumberdash/lib/src/lumberdash.dart Line 50 in 4c30df8
Something like this (pseudo-code): final shouldFilter = error.runtimeType == NonFatalError;
final exceptForClients = shouldFilter ? [PrintLumberdash] : [];
logError(error, exceptForClients); If you have an idea for a different API, please share it with us and we can take a look ;) |
Yes, this is possible that way, but not very convenient don't you think? Suppose you put Having this option for some logs is cool, but the more common use-case and far more useful use-case would be to restrict it at the logger level. You might say now: But it's not possible to customize an existing logger. For example: We only want to log errors to sentry, so doing something like this: SentryLumberdash.withDsn(
dsn: "...",
logLevels: [LogLevel.warning, LogLevel.error]
); The example above would give the developer the most freedom. |
We definitly see value in introducing the concept of log levels to lumberdash and being able to configure the routing of messages to appenders in a central location. It's on our roadmap and we may be able to add this later this year. |
Hi,
Great library! Especially now supporting multiple loggers.
However I have a feature suggesting in that I would like to be able to only log certain levels of errors.
Ideally this level would be per logger but I guess the least impact would be in the main Lumberdash client.
Usecase:
Log error and fatal's to Crashlytics and the rest to the console.
Thanks
Paul
The text was updated successfully, but these errors were encountered: