SourceHorizon / logger

Small, easy to use and extensible logger which prints beautiful logs.
https://pub.dev/packages/logger
MIT License
197 stars 33 forks source link

Advanced File Output #65

Closed pyciko closed 5 months ago

pyciko commented 6 months ago

This type of file output is mainly targeted for low-cost IoT platforms (like RPi). It optimises some of the aspects of the original File Output, specifically:

Bungeefan commented 6 months ago

Hi! Thanks for the nice pull request!

However, before further reviewing your request, unfortunately, the check for Dart 2.17 failed. Platform.lineTerminator was only introduced in Dart 3.1.0 and this library tries to maintain compatibility with at least 2.17.

I would suggest that you simply replace your usages with the original implementation behind the property:

static String get lineTerminator => isWindows ? '\r\n' : '\n';

https://github.com/dart-lang/sdk/blob/3.1.0/sdk/lib/io/platform.dart#L245

pyciko commented 6 months ago

Done

Bungeefan commented 6 months ago

That was quick, thanks! I submitted a review (my first ever on GitHub), you should be able to see it now. Don't be put off by the amount of comments, I still consider your pull request as well-made!

Bungeefan commented 6 months ago

Feel free to overwrite my changes as you see fit.

Bungeefan commented 6 months ago

Please review the new documentation, I tried to implement your description as well as I could!

pyciko commented 6 months ago

Thanks, yeah, English is not my native lang, your text looks much better.

pyciko commented 5 months ago

Thx for approval, can't wait to see it released!

Bungeefan commented 5 months ago

Sure, maybe next time don't close it if you want it to be merged ;)

Anyway, thanks again for the nice FileOutput! I think it's a fantastic addition to this project, and thank you for keeping up with my repeated change requests!

Bungeefan commented 5 months ago

logger v2.2.0 is now available on pub.dev!

neiljaywarner commented 5 months ago

so sorry if this is a dumb question, but does this library include file logging or is it a possible future thing?

pyciko commented 5 months ago

so sorry if this is a dumb question, but does this library include file logging or is it a possible future thing?

If you're using version 2.2.0 or newer, it does include Advanced File Logging with functions described above. It also includes basic FileLogger that existed even earlier.