$ npm install @arch-herobrine/logger.js
import Logger from "@arch-herobrine/logger.js"
const logger = new Logger({timeZone:"UTC"});
logger.log("this is log");
// -> [ log --- 2024/01/31 16:00:00 (UTC+00:00) ] this is log
logger.log("new\nline");
// -> [ log --- 2024/01/31 16:00:00 (UTC+00:00) ]
// new
// line
new Logger(options: LoggerOptions);
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
timeZone | String | ✓ | "UTC" | Time zone used for logs |
Output log to console.
Parametar | Type | Optional | Default | Description |
---|---|---|---|---|
message | any | ✓ | none | Almost the same as console.log() . |
optionalParams | any | ✓ | none | Almost the same as console.log() . |
Output info log to console.
Parametar | Type | Optional | Default | Description |
---|---|---|---|---|
message | any | ✓ | none | Almost the same as console.log() . |
optionalParams | any | ✓ | none | Almost the same as console.log() . |
Output warn log to console.
Parametar | Type | optional | Default | Description |
---|---|---|---|---|
message | any | ✓ | none | Almost the same as console.warn() . |
optionalParams | any | ✓ | none | Almost the same as console.warn() . |
Output error log to console.
Parametar | Type | Optional | Default | Description |
---|---|---|---|---|
message | any | ✓ | none | Almost the same as console.error() . |
optionalParams | any | ✓ | none | Almost the same as console.error() . |
Emitted whenever the function Logger.log()
is executed.
Parameter | Type | Description |
---|---|---|
log | string | String output to console. |
Emitted whenever the function Logger.info()
is executed.
Parameter | Type | Description |
---|---|---|
log | string | String output to console. |
Emitted whenever the function Logger.warn()
is executed.
Parameter | Type | Description |
---|---|---|
log | string | String output to console. |
Emitted whenever the function Logger.error()
is executed.
Parameter | Type | Description |
---|---|---|
log | string | String output to console. |