Skip to content

Commit

Permalink
fix:util._extend is deprecated in node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 committed May 27, 2024
1 parent 3315d59 commit 2569749
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var formatters = {

function Logger(options) {
var defaults = JSON.parse(JSON.stringify(Logger.DEFAULTS));
options = util._extend(defaults, options || {});
options = Object.assign({}, defaults, options || {});
var catcher = deLiner();
var emitter = catcher;
var transforms = [
Expand Down Expand Up @@ -103,7 +103,7 @@ function reLiner() {
}

function objectifier() {
return through(objectify, null, {autoDestroy: false});
return through(objectify, null, { autoDestroy: false });

function objectify(line) {
this.emit('data', {
Expand All @@ -127,7 +127,7 @@ function textFormatter(options) {

function textify(logEvent) {
var line = util.format('%s%s', textifyTags(logEvent.tag),
logEvent.msg.toString());
logEvent.msg.toString());
if (options.timeStamp) {
line = util.format('%s %s', new Date(logEvent.time).toISOString(), line);
}
Expand Down

0 comments on commit 2569749

Please sign in to comment.