node-lambda-log icon indicating copy to clipboard operation
node-lambda-log copied to clipboard

Setting log.options.logHandler doesn't seems to work

Open cldsnchz opened this issue 3 years ago • 1 comments

Hi, when I set log.options.logHandler = myConsole and the call log.info("test") myConsole is not being invoked.

However the following 2 alternatives work fine: log.console = myConsole and log = new LambdaLog({logHandler: myConsole})

I think this is because internally LambdaLog use the property console and that property is only set during the constructor. I mention this because the documentation uses log.options.logHandler = myConsole

I'm using version 3.0.0

BTW the property options.logHandler it is not defined in the typescript types.

Thanks

cldsnchz avatar Jun 02 '21 00:06 cldsnchz

Ah, got bitten by this. Thank you for the workaround.

Mudpuppy12 avatar Mar 09 '22 21:03 Mudpuppy12