Page 1 of 1

Create settings form for svyLogManager

PostPosted: Wed Jul 04, 2018 11:12 am
by jdbruijn
Recently I have started to use the svyLogManager for logging in my solution, instead of using application.output.
I am using the following code to create the logger instances (each is created in its own scope):
var log_mod1 = scopes.logger.getLogger('myApp.mod1');
var log_mod2 = scopes.logger.getLogger('myApp.mod2');
var log_import = scopes.logger.getLogger('myApp.mod2.import');

And next I can set the logging level for each logger:
scopes.logger.getLogger('myApp').setLevel('error');
scopes.logger.getLogger('myApp.mod2').setLevel('debug');
scopes.logger.getLogger('myApp.mod2.import').setLevel('trace');

Next, I want to have a settings form where I can select each logger to set the correct logging level. I think I need to add this to the getLogger function to generate some sort of structure that can be used for this (maybe a tree ?) Has anyone done this before for the svyLogManager? Or any general ideas I can use for this?