@tinkoff/logger
Advanced tools
Comparing version 0.10.170 to 0.10.171
@@ -10,2 +10,3 @@ /// <reference types="node" /> | ||
compact?: boolean; | ||
depth?: number; | ||
}; | ||
@@ -12,0 +13,0 @@ } |
import util from 'util'; | ||
import mergeDeep from '@tinkoff/utils/object/mergeDeep'; | ||
import { parseStack } from './utils/error.es.js'; | ||
@@ -17,3 +18,3 @@ import { writeStream } from './utils/stream.es.js'; | ||
constructor(options) { | ||
this.options = { ...DEFAULTS, ...options }; | ||
this.options = mergeDeep(DEFAULTS, options); | ||
} | ||
@@ -20,0 +21,0 @@ // eslint-disable-next-line class-methods-use-this |
@@ -6,2 +6,3 @@ 'use strict'; | ||
var util = require('util'); | ||
var mergeDeep = require('@tinkoff/utils/object/mergeDeep'); | ||
var error = require('./utils/error.js'); | ||
@@ -14,2 +15,3 @@ var stream = require('./utils/stream.js'); | ||
var util__default = /*#__PURE__*/_interopDefaultLegacy(util); | ||
var mergeDeep__default = /*#__PURE__*/_interopDefaultLegacy(mergeDeep); | ||
@@ -27,3 +29,3 @@ const DEFAULTS = { | ||
constructor(options) { | ||
this.options = { ...DEFAULTS, ...options }; | ||
this.options = mergeDeep__default["default"](DEFAULTS, options); | ||
} | ||
@@ -30,0 +32,0 @@ // eslint-disable-next-line class-methods-use-this |
import figures from 'figures'; | ||
import chalk from 'chalk'; | ||
import mergeDeep from '@tinkoff/utils/object/mergeDeep'; | ||
import { NodeBasicReporter } from './nodeBasic.es.js'; | ||
@@ -24,3 +25,3 @@ import { parseStack } from './utils/error.es.js'; | ||
constructor(options) { | ||
super({ ...DEFAULTS, ...options }); | ||
super(mergeDeep(DEFAULTS, options)); | ||
} | ||
@@ -27,0 +28,0 @@ // eslint-disable-next-line class-methods-use-this |
@@ -7,2 +7,3 @@ 'use strict'; | ||
var chalk$1 = require('chalk'); | ||
var mergeDeep = require('@tinkoff/utils/object/mergeDeep'); | ||
var nodeBasic = require('./nodeBasic.js'); | ||
@@ -17,2 +18,3 @@ var error = require('./utils/error.js'); | ||
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk$1); | ||
var mergeDeep__default = /*#__PURE__*/_interopDefaultLegacy(mergeDeep); | ||
@@ -35,3 +37,3 @@ const DEFAULTS = { | ||
constructor(options) { | ||
super({ ...DEFAULTS, ...options }); | ||
super(mergeDeep__default["default"](DEFAULTS, options)); | ||
} | ||
@@ -38,0 +40,0 @@ // eslint-disable-next-line class-methods-use-this |
{ | ||
"name": "@tinkoff/logger", | ||
"version": "0.10.170", | ||
"version": "0.10.171", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -23,4 +23,3 @@ # Logger | ||
You can create child loggers using method `.child` of the current logger instance. | ||
Child logger will inherit parent logger settings and can override these settings. | ||
You can create child loggers using method `.child` of the current logger instance. Child logger will inherit parent logger settings and can override these settings. | ||
@@ -68,3 +67,3 @@ :::info | ||
For control of displaying logs on server environment variables `LOG_LEVEL` and `LOG_ENABLE` are used: | ||
For control of displaying logs on server environment variables `LOG_LEVEL`, `LOG_ENABLE` and `LOG_DEFAULT_REPORTER_DEPTH` are used: | ||
@@ -77,2 +76,4 @@ - LOG_LEVEL = trace | debug | info | warn | error | fatal - enables displaying logs for specified level and higher. E.g.: | ||
- if `LOG_ENABLE=info:server,client,trace:shared` then displaying logs will be enabled for specified loggers using rules above | ||
- LOG_DEFAULT_REPORTER_DEPTH = `${number}` - specifies how deep the objects will be displayed in the logs. E.g.: | ||
- if `LOG_DEFAULT_REPORTER_DEPTH=3` we will see the values in the log objects up to `object.a.b.c` | ||
@@ -176,3 +177,3 @@ #### Display logs in browser | ||
fatal?: boolean; | ||
} | ||
}; | ||
} | ||
@@ -238,3 +239,6 @@ | ||
const traceLog = logger({ name: 'log-trace', defaults: { remote: { emitLevels: { trace: true } }}}); // override RemoteReporter settings | ||
const traceLog = logger({ | ||
name: 'log-trace', | ||
defaults: { remote: { emitLevels: { trace: true } } }, | ||
}); // override RemoteReporter settings | ||
@@ -241,0 +245,0 @@ traceLog.trace('test'); // will be sent to api |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84209
2142
329