From caf31d44d83a44f14d41ac286940fb8331c7ad0d Mon Sep 17 00:00:00 2001 From: Radbuglet Date: Mon, 19 Feb 2018 11:48:35 -0800 Subject: [PATCH] Fixed deprecation warning The module used to use the `sys` module which is now deprecated. I replaced it with `util` which isn't. --- logger.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/logger.js b/logger.js index 33e5690..232f65c 100644 --- a/logger.js +++ b/logger.js @@ -29,7 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE. */ var path = require('path'), - sys = require('sys'), + util = require('util'), fs = require('fs'); var makeArray = function(nonarray) { @@ -40,7 +40,7 @@ var makeArray = function(nonarray) { // if `log_file_path` is null, log to STDOUT. var Logger = function(log_file_path) { // default write is STDOUT - this.write = sys.print; + this.write = util.print; this.log_level_index = 3; // if a path is given, try to write to it @@ -71,7 +71,7 @@ Logger.prototype.setLevel = function(new_level) { // The base logging method. If the first argument is one of the levels, it logs // to that level, otherwise, logs to the default level. Can take `n` arguments -// and joins them by ' '. If the argument is not a string, it runs `sys.inspect()` +// and joins them by ' '. If the argument is not a string, it runs `util.inspect()` // to print a string representation of the object. Logger.prototype.log = function() { var args = makeArray(arguments), @@ -91,7 +91,7 @@ Logger.prototype.log = function() { if (typeof arg === 'string') { message += ' ' + arg; } else { - message += ' ' + sys.inspect(arg, false, null); + message += ' ' + util.inspect(arg, false, null); } }); message = this.format(Logger.levels[log_index], new Date(), message); @@ -112,4 +112,4 @@ Logger.levels.forEach(function(level) { exports.Logger = Logger; exports.createLogger = function(log_file_path) { return new Logger(log_file_path); -}; \ No newline at end of file +};