Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #55 from doug-martin/master
Browse files Browse the repository at this point in the history
v0.2.10
  • Loading branch information
doug-martin committed Feb 27, 2014
2 parents a9ab070 + ea99a61 commit a5f7848
Show file tree
Hide file tree
Showing 7 changed files with 205 additions and 149 deletions.
4 changes: 4 additions & 0 deletions History.md
@@ -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
Expand Down
140 changes: 76 additions & 64 deletions docs-md/coverage.html

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/History.html
Expand Up @@ -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>
Expand Down
32 changes: 22 additions & 10 deletions docs/comb_logging_Logger.html
Expand Up @@ -926,7 +926,9 @@ <h3>
<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>
Expand Down Expand Up @@ -978,7 +980,9 @@ <h3>
<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>
Expand Down Expand Up @@ -1030,7 +1034,9 @@ <h3>
<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>
Expand Down Expand Up @@ -1204,7 +1210,9 @@ <h3>
<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>
Expand Down Expand Up @@ -1303,12 +1311,12 @@ <h3>
<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;;
Expand Down Expand Up @@ -1530,7 +1538,9 @@ <h3>
<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>
Expand Down Expand Up @@ -1582,7 +1592,9 @@ <h3>
<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>
Expand Down
140 changes: 76 additions & 64 deletions docs/coverage.html

Large diffs are not rendered by default.

32 changes: 22 additions & 10 deletions lib/logging/index.js
Expand Up @@ -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)));
}
},

/**
Expand All @@ -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)));
}
},

/**
Expand All @@ -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)));
}
},

/**
Expand All @@ -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)));
}
},

/**
Expand All @@ -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)));
}
},

/**
Expand All @@ -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)));
}
},

/**
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -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",
Expand Down

0 comments on commit a5f7848

Please sign in to comment.