Permalink
Browse files

updates - 0.0.5

  • Loading branch information...
1 parent f567903 commit 2bf8daeb1252d78ada7b3e893164d869b9cf0e8c @contra contra committed Aug 27, 2012
Showing with 9 additions and 29 deletions.
  1. +0 −7 README.md
  2. +8 −9 lib/logger.coffee
  3. +0 −12 lib/package.coffee
  4. +1 −1 package.json
View
@@ -9,8 +9,6 @@ To install node-log, use [npm](http://github.com/isaacs/npm):
## Usage
-node-log will automatically detect the application name via your package.json file or you can specify it at runtime.
-
```
var log = require('node-log');
log.setName('mysupercoolapp');
@@ -22,11 +20,6 @@ log.info('seriously watch out');
```
![pic](http://i.imgur.com/ZkzU0.png)
-You only need to specify the name once during the start of your application unless you want to change it.
-
-## Contributors
-
-- [Contra](https://github.com/Contra)
## LICENSE
View
@@ -1,12 +1,11 @@
require('coffee-script');
require 'colors'
-pack = require('./package').load()
-
-module.exports =
- log: (str...) -> console.log '[' + pack.name.magenta + ']', str...
- debug: (str...) -> console.log '[' + pack.name.magenta, '-', 'debug'.green + ']', str...
- info: (str...) -> console.log '[' + pack.name.magenta, '-', 'info'.white + ']', str...
- warn: (str...) -> console.log '[' + pack.name.magenta, '-', 'warn'.yellow + ']', str...
- error: (str...) -> console.log '[' + pack.name.magenta, '-', 'error'.red + ']', str...
- setName: (str) -> pack.name = str
+module.exports = log =
+ name: 'default'
+ log: (str...) -> console.log '[' + log.name.magenta + ']', str...
+ debug: (str...) -> console.log '[' + log.name.magenta, '-', 'debug'.green + ']', str...
+ info: (str...) -> console.log '[' + log.name.magenta, '-', 'info'.white + ']', str...
+ warn: (str...) -> console.log '[' + log.name.magenta, '-', 'warn'.yellow + ']', str...
+ error: (str...) -> console.log '[' + log.name.magenta, '-', 'error'.red + ']', str...
+ setName: (str) -> log.name = str
View
@@ -1,12 +0,0 @@
-fs = require 'fs'
-path = require 'path'
-
-# Singleton for the contents of package.json
-exports.load = ->
- places = [path.join(process.cwd(), 'package.json'), path.join(__dirname, '../../', 'package.json')]
- if !@package
- @package = JSON.parse(fs.readFileSync(place)) for place in places when !@package and fs.existsSync(place)
- if !@package
- appName = path.basename(require.main.filename).replace(path.extname(require.main.filename), '')
- @package = {name: appName}
- return @package
View
@@ -1,7 +1,7 @@
{
"name":"node-log",
"description":"Simple logger for NodeJS",
- "version":"0.0.4",
+ "version":"0.0.5",
"homepage":"http://github.com/wearefractal/node-log",
"repository":"git://github.com/wearefractal/node-log.git",
"author":"Fractal <contact@wearefractal.com> (http://wearefractal.com/)",

0 comments on commit 2bf8dae

Please sign in to comment.