diff --git a/.versions b/.versions index 6c88a4f..f942ef2 100644 --- a/.versions +++ b/.versions @@ -11,7 +11,7 @@ meteor@1.1.14 modules@0.6.1 modules-runtime@0.6.3 ostrio:logger@1.1.2 -ostrio:loggerconsole@1.2.0 +ostrio:loggerconsole@1.2.1 promise@0.6.7 random@1.0.9 reactive-var@1.0.9 diff --git a/loggerconsole.coffee b/loggerconsole.coffee index 0635c97..7d75993 100755 --- a/loggerconsole.coffee +++ b/loggerconsole.coffee @@ -50,37 +50,23 @@ class LoggerConsole error: (obj, message) -> if obj.level is 'FATAL' process.stdout.write colorize('red', colorize('bold', message)) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' else process.stdout.write colorize('red', message) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' return info: (obj, message) -> process.stdout.write colorize('cyan', message) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' return warn: (obj, message) -> process.stdout.write colorize('magenta', message) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' return debug: (obj, message) -> process.stdout.write colorize('white', colorize('bold', message)) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' return trace: (obj, message) -> process.stdout.write colorize('blue', message) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' return log: (obj, message) -> process.stdout.write colorize('bold', message) + '\r\n' - if obj.data and not _.isEmpty obj.data - process.stdout.write JSON.stringify(obj.data, false, 2) + '\r\n' return else self.cons = @@ -148,7 +134,9 @@ class LoggerConsole message = '%c' + _message + '' else if Meteor.isServer - message = '[' + obj.level + ': ' + obj.message + ' @ ' + obj.time + '] ' + message = '[' + obj.level + ': ' + obj.message + ' @ ' + obj.time + '] ' + '\r\n' + if obj.data and not _.isEmpty obj.data + message += JSON.stringify(obj.data, false, 2) + '\r\n' else message = '%c[' + obj.level + ': ' + obj.message + ']' diff --git a/package.js b/package.js index 91d9c2f..bef600c 100755 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'ostrio:loggerconsole', - version: '1.2.0', + version: '1.2.1', summary: 'Logging: Print Client\'s logs to Server\'s console, messages colorized for better readability', git: 'https://github.com/VeliovGroup/Meteor-logger-console', documentation: 'README.md'