platoai-log
Custom Winston logger format used by Plato AI.
installation
npm i -S @platoai/log
usage
Optionally export the following shell environment variables:
-
PLATOAI_LOG_LEVEL
, to:error
,warn
,info
,verbose
,debug
, orsilly
(defaults to:info
) -
PLATOAI_LOG_IS_JSON
, to:true
orfalse
(defaults to:false
)
const logger = require('@platoai/log');
and then use it like winston:
log.info("Hello, world.");
// logs: `info: [greeter] Hello, world.`
log.info("Hello, world.", {prefix: "greeter"});