Permalink
Browse files

Merge pull request #55 from doug-martin/master

v0.2.10
  • Loading branch information...
2 parents a9ab070 + ea99a61 commit a5f78482b6d0f7fc5b580902ef64ba6a113fd52d @doug-martin doug-martin committed Feb 27, 2014
Showing with 205 additions and 149 deletions.
  1. +4 −0 History.md
  2. +76 −64 docs-md/coverage.html
  3. +4 −0 docs/History.html
  4. +22 −10 docs/comb_logging_Logger.html
  5. +76 −64 docs/coverage.html
  6. +22 −10 lib/logging/index.js
  7. +1 −1 package.json
View
@@ -1,3 +1,7 @@
+# 0.2.10
+
+* Added check to log functions for level before formatting message or delegating to `log`.
+
# 0.2.9
* Increased `comb.Promise` performance
View
Oops, something went wrong.
View
@@ -280,6 +280,10 @@
+<h1>0.2.10</h1>
+<ul>
+<li>Added check to log functions for level before formatting message or delegating to <code>log</code>.</li>
+</ul>
<h1>0.2.9</h1>
<ul>
<li>Increased <code>comb.Promise</code> performance<ul>
@@ -926,7 +926,9 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (message){
- return this.log.apply(this, [Level.DEBUG].concat(argsToArray(arguments)));
+ if (this.isDebug) {
+ return this.log.apply(this, [Level.DEBUG].concat(argsToArray(arguments)));
+ }
}
</pre>
@@ -978,7 +980,9 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (message){
- return this.log.apply(this, [Level.ERROR].concat(argsToArray(arguments)));
+ if (this.isError) {
+ return this.log.apply(this, [Level.ERROR].concat(argsToArray(arguments)));
+ }
}
</pre>
@@ -1030,7 +1034,9 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (message){
- return this.log.apply(this, [Level.FATAL].concat(argsToArray(arguments)));
+ if (this.isFatal) {
+ return this.log.apply(this, [Level.FATAL].concat(argsToArray(arguments)));
+ }
}
</pre>
@@ -1204,7 +1210,9 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (message){
- return this.log.apply(this, [Level.INFO].concat(argsToArray(arguments)));
+ if (this.isInfo) {
+ return this.log.apply(this, [Level.INFO].concat(argsToArray(arguments)));
+ }
}
</pre>
@@ -1303,12 +1311,12 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (level,message){
- var args = argsToArray(arguments, 1);
level = Level.toLevel(level);
- if (args.length &gt; 1) {
- message = format.apply(null, args);
- }
if (level.isGreaterOrEqualToo(this.level)) {
+ var args = argsToArray(arguments, 1);
+ if (args.length &gt; 1) {
+ message = format.apply(null, args);
+ }
if (Level.TRACE.equals(level)) {
var err = new Error;
err.name = &quot;Trace&quot;;
@@ -1530,7 +1538,9 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (message){
- return this.log.apply(this, [Level.TRACE].concat(argsToArray(arguments)));
+ if (this.isTrace) {
+ return this.log.apply(this, [Level.TRACE].concat(argsToArray(arguments)));
+ }
}
</pre>
@@ -1582,7 +1592,9 @@
<em>Source</em>
<pre class="prettyprint linenums lang-js">
function (message){
- return this.log.apply(this, [Level.WARN].concat(argsToArray(arguments)));
+ if (this.isWarn) {
+ return this.log.apply(this, [Level.WARN].concat(argsToArray(arguments)));
+ }
}
</pre>
View
Oops, something went wrong.
View
@@ -258,7 +258,9 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
info: function (message) {
- return this.log.apply(this, [Level.INFO].concat(argsToArray(arguments)));
+ if (this.isInfo) {
+ return this.log.apply(this, [Level.INFO].concat(argsToArray(arguments)));
+ }
},
/**
@@ -269,7 +271,9 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
debug: function (message) {
- return this.log.apply(this, [Level.DEBUG].concat(argsToArray(arguments)));
+ if (this.isDebug) {
+ return this.log.apply(this, [Level.DEBUG].concat(argsToArray(arguments)));
+ }
},
/**
@@ -280,7 +284,9 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
error: function (message) {
- return this.log.apply(this, [Level.ERROR].concat(argsToArray(arguments)));
+ if (this.isError) {
+ return this.log.apply(this, [Level.ERROR].concat(argsToArray(arguments)));
+ }
},
/**
@@ -291,7 +297,9 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
warn: function (message) {
- return this.log.apply(this, [Level.WARN].concat(argsToArray(arguments)));
+ if (this.isWarn) {
+ return this.log.apply(this, [Level.WARN].concat(argsToArray(arguments)));
+ }
},
/**
@@ -302,7 +310,9 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
trace: function (message) {
- return this.log.apply(this, [Level.TRACE].concat(argsToArray(arguments)));
+ if (this.isTrace) {
+ return this.log.apply(this, [Level.TRACE].concat(argsToArray(arguments)));
+ }
},
/**
@@ -313,7 +323,9 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
fatal: function (message) {
- return this.log.apply(this, [Level.FATAL].concat(argsToArray(arguments)));
+ if (this.isFatal) {
+ return this.log.apply(this, [Level.FATAL].concat(argsToArray(arguments)));
+ }
},
/**
@@ -346,12 +358,12 @@ var Logger = (logging.Logger = define.define(null, {
* @return {comb.logging.Logger} for chaining.
*/
log: function (level, message) {
- var args = argsToArray(arguments, 1);
level = Level.toLevel(level);
- if (args.length > 1) {
- message = format.apply(null, args);
- }
if (level.isGreaterOrEqualToo(this.level)) {
+ var args = argsToArray(arguments, 1);
+ if (args.length > 1) {
+ message = format.apply(null, args);
+ }
if (Level.TRACE.equals(level)) {
var err = new Error;
err.name = "Trace";
View
@@ -1,7 +1,7 @@
{
"name": "comb",
"description": "A framework for node",
- "version": "0.2.9",
+ "version": "0.2.10",
"keywords": ["OO", "Object Oriented", "Collections", "Tree", "HashTable", "Pool", "Logging", "Promise", "Promises", "Proxy"],
"repository": {
"type": "git",

0 comments on commit a5f7848

Please sign in to comment.