2014-11-13 21:34:04 +01:00
|
|
|
/* jshint -W079 */
|
2014-12-22 21:45:59 -06:00
|
|
|
(function() {
|
|
|
|
var scribe = require('../scribe')(),
|
2014-12-19 18:09:05 +01:00
|
|
|
console = process.console,
|
|
|
|
express = require('express'),
|
2014-12-22 21:45:59 -06:00
|
|
|
app = express();
|
2014-11-13 21:34:04 +01:00
|
|
|
|
|
|
|
|
2014-12-22 21:45:59 -06:00
|
|
|
app.set('port', (process.env.PORT || 5000));
|
|
|
|
|
|
|
|
app.get('/', function(req, res) {
|
2014-12-19 18:09:05 +01:00
|
|
|
res.send('Hello world, see you at /logs');
|
|
|
|
});
|
2014-11-13 21:34:04 +01:00
|
|
|
|
2014-12-19 18:09:05 +01:00
|
|
|
app.use('/logs', scribe.webPanel());
|
2014-11-13 21:34:04 +01:00
|
|
|
|
|
|
|
|
2014-12-19 18:09:05 +01:00
|
|
|
//Make some logs
|
2014-12-21 21:25:32 -06:00
|
|
|
console.addLogger('debug', 'red');
|
|
|
|
console.addLogger('fun', 'red');
|
2014-11-13 21:34:04 +01:00
|
|
|
|
2014-12-19 18:09:05 +01:00
|
|
|
console.time().fun('hello world');
|
|
|
|
console.tag('This is a test').debug('A test');
|
|
|
|
console.tag('An object').log({
|
|
|
|
a: 'b',
|
2014-12-22 21:45:59 -06:00
|
|
|
c: [1, 2, 3]
|
2014-12-19 18:09:05 +01:00
|
|
|
});
|
2014-11-13 21:34:04 +01:00
|
|
|
|
2014-12-22 21:45:59 -06:00
|
|
|
var port = app.get("port");
|
|
|
|
|
|
|
|
app.listen(port, function() {
|
|
|
|
console.time().log('Server listening at port ' + port);
|
2014-12-19 18:09:05 +01:00
|
|
|
});
|
2014-12-22 21:45:59 -06:00
|
|
|
})();
|