commit 58cd9ced1a6ff858e49da52bbf31d63ad0193826 Author: James Allen Date: Mon Feb 17 14:54:20 2014 +0000 Initial open source commit diff --git a/libraries/logger/.gitignore b/libraries/logger/.gitignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/libraries/logger/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/libraries/logger/index.js b/libraries/logger/index.js new file mode 100755 index 0000000000..a1855a2839 --- /dev/null +++ b/libraries/logger/index.js @@ -0,0 +1,2 @@ +require("coffee-script") +module.exports = require('./logging-manager'); diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee new file mode 100644 index 0000000000..cc3a262cf6 --- /dev/null +++ b/libraries/logger/logging-manager.coffee @@ -0,0 +1,20 @@ +bunyan = require('bunyan') + +module.exports = Logger = + initialize: (name) -> + @logger = bunyan.createLogger + name: name + serializers: bunyan.stdSerializers + return @ + info : ()-> + @logger.info.apply(@logger, arguments) + log : ()-> + @logger.info.apply(@logger, arguments) + error: ()-> + @logger.error.apply(@logger, arguments) + err: ()-> + @logger.error.apply(@logger, arguments) + warn: ()-> + @logger.warn.apply(@logger, arguments) + +Logger.initialize("default-sharelatex") diff --git a/libraries/logger/package.json b/libraries/logger/package.json new file mode 100644 index 0000000000..e0e8455d09 --- /dev/null +++ b/libraries/logger/package.json @@ -0,0 +1,9 @@ +{ + "name": "logger-sharelatex", + "homepage": "www.sharelatex.com", + "version": "0.0.1", + "dependencies": { + "coffee-script": "1.4.0", + "bunyan": "0.16.x" + } +}