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
Debug has no global logger, only named loggers. And it is basically just a list, there is no hierarchy.
But it can simulate hierarchy through naming conventions. They recommend using colon : to separate levels:
By default, this would not produce any output, but you can enable loggers using a pattern:
debug.enable('my-app:my-module')// enables only the one moduledebug.enable('my-app:*')// enables every submodule of my-app
They translate the pattern and then use simple regex pattern matching on the name to determine if the logger is enabled or not. It works surprisingly well.
JSLogger should cascade the LogLevel configuration for named loggers based on their namespace, so for example:
var loggerA = Logger.get("parentNS.clientA");
// Configure the LogLevel of the parent namespace
Logger.get("parentNS").setLevel(Logger.WARN);
loggerA.info("Info Message"); // No output
loggerA.warn("Warning Message"): // Logs "Warning Message"
This feature would provide developers a way to express log levels for an entire group of clients without having to manually list them all out.
The text was updated successfully, but these errors were encountered: