Log to a file on windows, for now

This commit is contained in:
Matt Colyer
2013-10-28 13:42:18 -07:00
parent 86506752a7
commit cc42db3bff

View File

@@ -12,7 +12,12 @@ nslog = require 'nslog'
dialog = require 'dialog'
console.log = (args...) ->
nslog(args.map((arg) -> JSON.stringify(arg)).join(" "))
# TODO: Make NSLog work as expected
output = args.map((arg) -> JSON.stringify(arg)).join(" ")
if process.platform == 'darwin'
nslog(output)
else
fs.writeFileSync('debug.log', output, flag: 'a')
process.on 'uncaughtException', (error={}) ->
nslog(error.message) if error.message?