diff options
author | tomsmeding <hallo@tomsmeding.nl> | 2015-10-23 19:14:18 +0200 |
---|---|---|
committer | tomsmeding <hallo@tomsmeding.nl> | 2015-10-23 19:14:18 +0200 |
commit | fdef017b4966dcb26020555b0dc2afc1b573fc4a (patch) | |
tree | 981f178686fc13a0b62d18f6b9cff8a8b1c016d0 /interactor/interactor.js | |
parent | 51bf3a48efb1b4109507bb7aaba15dd62f8b1c0f (diff) |
Fix logging and disable pinging
Diffstat (limited to 'interactor/interactor.js')
-rwxr-xr-x | interactor/interactor.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/interactor/interactor.js b/interactor/interactor.js index c31b93f..e68e834 100755 --- a/interactor/interactor.js +++ b/interactor/interactor.js @@ -14,7 +14,8 @@ var app=require("express")(), http=require("http").Server(app), io=require("socket.io")(http), fs=require("fs"), - spawn=require("child_process").spawn; + spawn=require("child_process").spawn, + mkdirp=require("mkdirp"); eval(String(fs.readFileSync("common.js"))); @@ -66,6 +67,8 @@ function stopproc(proc){ }); } +mkdirp("logs"); + io.on("connection",function(conn){ var id=uniqid(); console.log("New IO connection id "+id); @@ -82,7 +85,7 @@ io.on("connection",function(conn){ ("00"+now.getDate()).slice(-2)+"-"+ ("00"+now.getHours()).slice(-2)+ ("00"+now.getMinutes()).slice(-2)+ - ("00"+now.getSeconds()).slice(-2), + ("00"+now.getSeconds()).slice(-2)+".txt", "w"); var log=function(s){ fs.writeSync(logfile,s+"\n"); |