daohoangson / flutter_widget_from_html

Flutter package to render html as widgets that supports hyperlink, image, audio, video, iframe and many other tags.
https://pub.dev/packages/flutter_widget_from_html
MIT License
635 stars 235 forks source link

Disabling logging the parser process #1119

Closed darkstarx closed 10 months ago

darkstarx commented 10 months ago

Hello! Thanks for the great package.

I would like to disable logging of the parser. It's very long process and there are many messages generated by the widget during parsing an html. This log is much larger than my application's log, so it becomes annoying to find my logs between huge amount of useless information.

image
daohoangson commented 10 months ago

By default, the log records are silent, you must have configured some printer for those? The ones in the screenshot have the "finest" level, which is very verbose. You can either increase the global level:

Logger.root.level = Level.FINE;

Or adjust your printer to ignore a log record by loggerName or similar.

darkstarx commented 10 months ago

No, I don't use print, it's not recommended. Instead, I use log from dart:developer for logging the messages from the Logger. Indeed, I can filter messages by the logger name, thank you for you advice!

rawthriver commented 1 month ago

Hi! There must be some option to disable logging. It is wrong that developer must write a patch to package to be sound and convenient (in fact yout do not know, how others using logger). For example, I can't just do so Logger('fwfh').level = Level.OFF;. Besides that, spawning loggers this way logger = Logger('fwfh.HtmlTable${loggers++}'), is not good. Consider using this index inside message. Anyway, thanks for such a useful package!