From 58cd9ced1a6ff858e49da52bbf31d63ad0193826 Mon Sep 17 00:00:00 2001 From: James Allen Date: Mon, 17 Feb 2014 14:54:20 +0000 Subject: [PATCH] Initial open source commit --- libraries/logger/.gitignore | 1 + libraries/logger/index.js | 2 ++ libraries/logger/logging-manager.coffee | 20 ++++++++++++++++++++ libraries/logger/package.json | 9 +++++++++ 4 files changed, 32 insertions(+) create mode 100644 libraries/logger/.gitignore create mode 100755 libraries/logger/index.js create mode 100644 libraries/logger/logging-manager.coffee create mode 100644 libraries/logger/package.json 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" + } +}