@just-web/log
provides a consistent logging API to @just-web
applications.
It supports customization with runtime protection, sanitization, remote reporting, log level control, etc.
This is a core module of @just-web
.
You do not need to reference this module directly.
The features of this module are exposed through @just-web/app
.
Import from @just-web/app
to write logs:
import { log, getLogger } from '@just-web/app'
function work() {
// ad-hoc logging
log.info('module', 'some log message')
// create a custom logger
const myLog = getLogger('module')
myLog.info('some log message')
}
Configure when creating the application:
import { createApp } from '@just-web/app'
const app = createApp({
log: { /* log options */ }
})
Please refer to the handbook
to learn more about it.
Generated using TypeDoc