Closed johnd0e closed 4 years ago
May be we should use some library.
It has AWESOME debug features. Just set
DEBUG=module1,module2
and these modules will start logging debug info
What would be the requirements of a logger?
filter by levels? filter by tags?
i think that exporting the log stack to a string could be useful to present a user the logs without opening the dev tools, could be useful for mobile devices. Showing it at the hidden debug tab at comm or from the about IITC for example.
See comment in upper post. May be similar functionality in other form.
could be useful for mobile devices.
IITCm has own console.
could be useful for mobile devices.
IITCm has own console.
yes, also desktop has, for less experienced users could be simplier that is only an idea, totally optional
@angel93ayora Well, may be. We could add 'share log' link to 'about iitc' dialog.
Another feature that I would like to have: optional popup notifications about errors.
Most of time we use iitc with closed console window, so we need to be notified about errors somehow.
It may be simple notification, or even pop-out console replacement.
i think that feature is not present on any of the libraries you said
my logger supports modules while storing all messages on the same stack, you can filter by module and level/minLevel and the filtered result can be printed through console or retrieved as a string
also not depending on a external library would give us the chance to insert desired features, like the one you said
log4javascript
has some similar.
And I can list more (like erudaconsole
).
Actually I do not expect that out-of-the-box, but want our logger to have some relevant extension-points.
E.g. ulog
has 'formatters' feature, which possibly can be hooked for our purposes. Haven't tried thought.
@angel93ayora Yeah, I will try to setup both.
I do not mind against custom logger, but as every new custom code - it needs debugging itself. There may be some unexpected caveats, etc.
iitc writes a lot of debug info to console log, but it's not useful for general use, and only adds 'noice' to log. It would be more useful if such thing were wrapped in something like this:
Condition could be more complex:
In order to control the condition ENABLE_LOG we could use additional plugin.