plugfox / l Goto Github PK
View Code? Open in Web Editor NEWCross-platform html/io [L]ogger with simple API.
Home Page: https://pub.dev/packages/l
License: MIT License
Cross-platform html/io [L]ogger with simple API.
Home Page: https://pub.dev/packages/l
License: MIT License
Hello!
There seems to be a specific combination of options and arguments that results in an uncontrollable Stack Overflow exception. I've managed to reproduce this behavior using the following code:
void main() => l.capture(
() => runZonedGuarded(
() => throw Exception(),
(e, s) => print(e),
),
LogOptions(
handlePrint: false,
),
);
Using the logger itself as the runZonedGuarded's onError argument or leaving the LogOptions' handlePrint as its default does not trigger the issue. The exception's StackTrace is not very informative, as it points to only two segments repeatedly, and those segments are _CustomZone.print and InnerZonedMixin.capture:
#0 _CustomZone._parentDelegate (dart:async/zone.dart:1150:3)
#1 _CustomZone.print (dart:async/zone.dart:1400:55)
#2 InnerZonedMixin.capture.<anonymous closure> (package:l/src/inner_zoned_mixin.dart:43:20)
#3 _CustomZone.print (dart:async/zone.dart:1402:19)
#4 InnerZonedMixin.capture.<anonymous closure> (package:l/src/inner_zoned_mixin.dart:43:20)
#5 _CustomZone.print (dart:async/zone.dart:1402:19)
#6 InnerZonedMixin.capture.<anonymous closure> (package:l/src/inner_zoned_mixin.dart:43:20)
...
Option to display logs in production
The 'Example of using the library' in Readme leads to the platform_info
example.
Android Studio is the latest version. Using integrated console.
Last successfull version 1.0.1
Could be nice to print Stack Trace to log when it had been passed to the l.e() or l.w()
For example if we passing Error and Stack Trace to the Sentry - we expect to see clear Error message without Stack Trace and Stack Trace as additional record.
And for the debug it could be nice to always see Stack Trace in the console if it is possible.
Maybe it could be option to print Stack Trace.
Set LogOptions with a global setter
l.options = LogOptions(/* ... */);
Specify separately the logging level for debugging and release
Field for indicating the maximum length of the log message.
If exceeded, transfer to the next line.
Also format multi-line comments.
1589308341934 [I] Single line
1589308342053 [I] Multi
| Line
| Message
1589308342053 [I] Single line
Could be nice to see Time for log messages with ability to set Date-Time format.
Like this:
Add off text color
Could be nice to add stackTrace parameter to easily print stackTrace to log using predefined formating.
final logOptions = LogOptions(
messageFormatting: formatLoggerMessage,
);
l.capture(fn, logOptions);
String formatLoggerMessage(
Object message,
-> StackTrace stackTrace,
logging.LogLevel level,
DateTime time,
Display color comments in Android Studio like in normal terminal
Override like this:
๐ 12:22:49.712326 DEBUG - DoSomeWork - This is debug message
๐ป 12:22:49.712369 INFO - DoSomeWork - This is info message
โ ๏ธ 12:22:49.712403 WARNING - DoSomeWork - This is warning message
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.