Support changing settings in one structure


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:

  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


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