Permalink
Browse files

-

  • Loading branch information...
1 parent 5718c97 commit ac00694613f07a1f1bab4a4f12aaf9c4f947cd98 @JoeHitchens JoeHitchens committed Sep 9, 2011
Showing with 11 additions and 11 deletions.
  1. +10 −10 README.md
  2. +1 −1 package.json
View
@@ -1,9 +1,9 @@
# log5 - A simple logging utility.
-Provides a simple module with a log() function and a logLevel value.
-The log() function writes the msg to stdout, prefixed with a timestamp, if
-the logLevel is greater than or equal to the number in the first argument.
+Provides a simple module with a log() function and a log level value.
+The log() function writes the msg to stdout, prefixed with a timestamp, when
+the log level is greater than or equal to the number in the first argument.
## Install
@@ -12,31 +12,31 @@ the logLevel is greater than or equal to the number in the first argument.
## Examples
- log5 = require("log5")
- log5.logLevel = 2
+ log = require("log5").mkLog()
+ log(2)
log(2, "This prints")
log(3, "This doesn't")
You are free to make up whatever level numbers you want, and assign what ever meaning to them that
you want.
It's very simple, and gets the job done, and allows you to change the log output at
-runtime if you like, by just changing the logLevel.
+runtime if you like, by just changing the log level.
## More examples
- log5 = require("log5") // log level defaults to 0
+ log = require("log5").mkLog() // log level defaults to 0
log = log5.log // for convenience
- log(1, "does not print") // because logLevel is 0
- log(1) // same as log5.logLevel = 1
+ log(1, "does not print") // because log level is 0
+ log(1) // set log level to 1
log(1, "prints")
log(-1) // sure, why not?
log(0, "does not print")
log("does not print") // if you don't include a # as first arg, 0 is used
log(0)
log("prints now")
log("foo", 7, ["bar","baz"]) // logs "foo 7 bar,baz"
- log(3, "foo", 7, ["bar","baz"]) // does not print - logLevel is 0
+ log(3, "foo", 7, ["bar","baz"]) // does not print - log level is 0
## License
View
@@ -1,6 +1,6 @@
{
"name": "log5",
- "version": "1.2.1",
+ "version": "1.2.3",
"description" : "A simple logging utility",
"author": "Joe Hitchens <joe@sleepless.com> (sleepless.com)",
"license": {

0 comments on commit ac00694

Please sign in to comment.