Closed taschmidt closed 4 years ago
Unfortunately, there isn't a way to do this globally at this time. You could use an environment variable on each one of your instances to control this globally. But in order for this package to support that functionality would require a refactor to how the default options are stored. It's definitely possible, but I'd have to find the time to make the changes.
For the quick workaround you could have an environment variable such as LAMBDALOG_SILENT=true
and each of your instances could use:
log.options.silent = process.env.LAMBDALOG_SILENT === 'true';
Thanks for the quick response! That would work. I suppose I could also also do that in either a derived class (I'm actually using Typescript) or a factory method.
Glad that helps, let me know if you run into any issues!
I know I can set
log.options.silent = true
on a particular instance of LambdaLog. But I would like to globally silence output (across ALL instances), in this case from unit tests. Is there any way to accomplish this?Thanks! tim