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
Describe the bug
Not defining a custom Logger makes it use the PrettyPrinter of the logger package instead MyLogPrinter provided by this package. Also loggingLevel has no effect because of this.
To Reproduce
Do anything that causes a log. Do not use a custom logger. Also notice that changing loggingLevel doesn't do anything
Expected behavior
I expect it to work like in 0.5.2 or before. Now, it's not using the provided methods of the Log class anymore, (like debug, warn etc.) therefore bypassing the autoInit and the factories.
System Infomation()
Flutter SDK Version: Flutter (Channel stable, 3.3.8)
Target OS and Version: (flutter web) Chrome Version 107.0.5304.107 (Official Build) (64-bit)
Host OS and Version: Microsoft Windows [Version 10.0.19044.2251]
The text was updated successfully, but these errors were encountered:
The current code of the Log class seems also very strange to me and overly complicated. I refactored it myself locally to this to solve this bug and also making the class much simpler:
Logger logger = Log();
class Log extends Logger {
Log(): super(printer: MyLogPrinter('.')) {
StackTraceNJ frames = StackTraceNJ();
if (frames.frames != null) {
for (Stackframe frame in frames.frames!) {
_localPath = frame.sourceFile.path
.substring(frame.sourceFile.path.lastIndexOf('/'));
break;
}
}
}
static late String _localPath;
static Level _loggingLevel = Level.debug;
static set loggingLevel(Level loggingLevel) => _loggingLevel = loggingLevel;
}
I think this will result with identical behavior as before without all unnecessary factories and other overcomplications. It also revealed some spots in the package where the logger was called incorrectly, like Log.d instead of logger.d
Describe the bug
Not defining a custom Logger makes it use the PrettyPrinter of the logger package instead MyLogPrinter provided by this package. Also loggingLevel has no effect because of this.
To Reproduce
Do anything that causes a log. Do not use a custom logger. Also notice that changing loggingLevel doesn't do anything
Expected behavior
I expect it to work like in 0.5.2 or before. Now, it's not using the provided methods of the Log class anymore, (like
debug
,warn
etc.) therefore bypassing theautoInit
and the factories.System Infomation()
Flutter SDK Version: Flutter (Channel stable, 3.3.8)
Target OS and Version: (flutter web) Chrome Version 107.0.5304.107 (Official Build) (64-bit)
Host OS and Version: Microsoft Windows [Version 10.0.19044.2251]
The text was updated successfully, but these errors were encountered: