Skip to content

Commit

Permalink
resistance is futile
Browse files Browse the repository at this point in the history
  • Loading branch information
gradus committed Apr 12, 2012
1 parent aa9392a commit 31a5258
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion examples/server.js
@@ -1 +1 @@
require('../bin/saucer')
saucer = require('../bin/saucer')
4 changes: 4 additions & 0 deletions lib/saucer.js
Expand Up @@ -41,3 +41,7 @@ saucer.App = require('./saucer/app').App;
saucer.log = require('./saucer/log');

saucer.log.info('Hello Earth');

saucer.log.warn('...Warning...');

saucer.log.error('Self destruction approaches');
10 changes: 9 additions & 1 deletion lib/saucer/log.js
@@ -1,9 +1,17 @@
var log;

log = exports;
log = module.exports;

require('colors');

log.info = function(output) {
return console.log(output.cyan);
};

log.warn = function(output) {
return console.log(output.magenta);
};

log.error = function(output) {
return console.log(output.red);
};
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -71,7 +71,7 @@ app = saucer.app
earth = app.render view: earth
app.get /hello earth, ->
app.router.get '/', earth, ->
@res earth
app.listen 8888
Expand Down
4 changes: 3 additions & 1 deletion src/saucer.coffee
Expand Up @@ -26,5 +26,7 @@ saucer = exports

saucer.App = require('./saucer/app').App
saucer.log = require('./saucer/log')

saucer.log.info 'Hello Earth'
saucer.log.warn '...Warning...'
saucer.log.error 'Self destruction approaches'

3 changes: 0 additions & 3 deletions src/saucer/app.coffee
@@ -1,4 +1 @@
app = exports.App



7 changes: 6 additions & 1 deletion src/saucer/log.coffee
@@ -1,8 +1,13 @@
log = exports
log = module.exports

require 'colors'

log.info = (output) ->
console.log output.cyan

log.warn = (output) ->
console.log output.magenta

log.error = (output) ->
console.log output.red

0 comments on commit 31a5258

Please sign in to comment.