Use nslog on Windows.

This commit is contained in:
Cheng Zhao
2014-01-20 21:50:37 +08:00
parent 3aa67bff8b
commit 4d74a69277

View File

@@ -7,16 +7,14 @@ fs = require 'fs'
module = require 'module'
path = require 'path'
optimist = require 'optimist'
# TODO: NSLog is missing .lib on windows
nslog = require 'nslog' unless process.platform is 'win32'
nslog = require 'nslog'
dialog = require 'dialog'
console.log = (args...) ->
# TODO: Make NSLog work as expected
output = args.map((arg) -> JSON.stringify(arg)).join(" ")
if process.platform == 'darwin'
nslog(output)
else
nslog(output)
if process.platform isnt 'darwin'
fs.writeFileSync('debug.log', output, flag: 'a')
process.on 'uncaughtException', (error={}) ->