You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you please support an external logger as an optional alternative to the internal print? Something like:
import'dart:developer';
SmtpClient.logger = log;
where log is
voidlog(String message, {
DateTime? time,
int? sequenceNumber,
int level =0,
String name ='',
Zone? zone,
Object? error,
StackTrace? stackTrace,
});
``` from the `dart:developer`.
and in your `ClientBase.log` method smth like:
```dart
typedefLogger=voidFunction(String message, {String name});
/// An optional external logger.Logger? logger;
voidlog(finalObject? logObject, {
finalbool isClient =true,
String? initial,
})
{
if (isLogEnabled) {
initial ??= (isClient ==true) ? initialClient : initialServer;
if (logger !=null) {
logger(logObject?.toString() ??'',
name: initial,
);
} elseif (logName !=null) {
logger()
print('$logName $initial: $logObject');
} else {
print('$initial: $logObject');
}
}
}
So it will be compatible with dart:developer and package:logging at the choice of the package user.
As an alternative, you could use package:logging inside of your package and provide an access to the log level of this logger to set the log level externally (like in the hotreloader package).
Thanks again for your package, guys!
The text was updated successfully, but these errors were encountered:
Hi!
Thanks for the great package!
Can you please support an external logger as an optional alternative to the internal
print
? Something like:where
log
isSo it will be compatible with
dart:developer
andpackage:logging
at the choice of the package user.As an alternative, you could use
package:logging
inside of your package and provide an access to the log level of this logger to set the log level externally (like in the hotreloader package).Thanks again for your package, guys!
The text was updated successfully, but these errors were encountered: