1

Closed

Support changing settings in one structure

description

Right now, in order to change things like the default level and individual switch levels, calls must be made individually like:
Trace.traceLevel('foo', Trace.Levels.error);
Trace.defaultLevel = Trace.Levels.off;

it would be nicer if settings could be specified like this:

Trace.config({
  defaultLevel: Trace.Levels.off,
  levels: {
     foo: Trace.Levels.error,
     bar: Trace.Levels.log
  }
});

Maybe additionally support things like Require does where it detects the presence of an existing "require" variable and uses that for config, so we'd just set "Trace" equal to the config object literal above in order to configure it.
Closed Feb 11, 2014 at 7:49 PM by tommck

comments

tommck wrote Feb 11, 2014 at 7:28 PM

Not doing the "require" variable style function, but am adding Trace.config

wrote Feb 11, 2014 at 7:32 PM

wrote Feb 11, 2014 at 7:49 PM