Skip to content
Browse files

Adding env example

  • Loading branch information...
1 parent d5dd940 commit acb9338f21e579c128f7996478de97530f4eec66 @vesln committed Dec 29, 2011
Showing with 33 additions and 0 deletions.
  1. +33 −0 examples/env.js
View
33 examples/env.js
@@ -0,0 +1,33 @@
+/**
+ * Logme - Minimalistic logging.
+ *
+ * Author: Veselin Todorov <hi@vesln.com>
+ * Licensed under the MIT License.
+ */
+
+/**
+ * Dependencies.
+ */
+var Logme = require('../').Logme;
+
+/**
+ * Logme configurations.
+ *
+ * @type {Object}
+ */
+var config = {
+ level: 'debug'
+};
+
+/**
+ * Checks if the node env var is production and if so
+ * sets the log level to critical.
+ */
+if (process.env.NODE_ENV === 'production') {
+ config.level = 'critical';
+}
+
+/**
+ * Exporting the lib.
+ */
+module.exports = new Logme(config);

0 comments on commit acb9338

Please sign in to comment.
Something went wrong with that request. Please try again.