Restored the errorlog function, fixes a bug

This commit is contained in:
Peter 'Pita' Martischka 2011-05-19 22:22:12 +01:00
parent eadc8fcf3b
commit 42dfb31cf8
1 changed files with 18 additions and 2 deletions

View File

@ -16,8 +16,6 @@
require('joose');
//var http = require('http')
//var url = require('url')
var socketio = require('socket.io')
var settings = require('./settings')
var db = require('./db')
@ -120,6 +118,24 @@ async.waterfall([
}
]);
function errorlog(e)
{
var timeStr = new Date().toUTCString() + ": ";
if(typeof e == "string")
{
console.error(timeStr + e);
}
else if(e.stack != null)
{
console.error(timeStr + e.stack);
}
else
{
console.error(timeStr + JSON.stringify(e));
}
}
function randomPadName()
{
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";