mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-19 06:21:08 +00:00
fix logging
This commit is contained in:
parent
8fb1582164
commit
31f7946437
3 changed files with 7 additions and 6 deletions
4
app.js
4
app.js
|
|
@ -9,8 +9,8 @@ var options = {
|
|||
port: settings.port,
|
||||
'online-mode': settings.onlineMode,
|
||||
gameMode:settings.gameMode,
|
||||
logging: settings.logging,
|
||||
commands: commands
|
||||
commands: commands,
|
||||
logging:settings.logging
|
||||
};
|
||||
|
||||
mcServer.createMCServer(options);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@
|
|||
"port": 25565,
|
||||
"maxPlayers": 10,
|
||||
"onlineMode": true,
|
||||
"logging": false,
|
||||
"logging": true,
|
||||
"gameMode": 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
var fs = require('fs');
|
||||
var timeStarted = Math.floor(new Date() / 1000).toString();
|
||||
|
||||
var path = require('path');
|
||||
|
||||
module.exports=inject;
|
||||
|
||||
|
|
@ -19,13 +19,14 @@ function inject(serv,settings)
|
|||
|
||||
function log(message) {
|
||||
if (settings.logging == true) {
|
||||
fs.appendFile("logs/" + timeStarted + ".log", message + "\n", function (err) {
|
||||
fs.appendFile(path.join(__dirname,'..','..',"logs",timeStarted + ".log") , message + "\n", function (err) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function createLog() {
|
||||
fs.writeFile("logs/" + timeStarted + ".log", "[INFO]: Started logging...\n", function (err, data) {
|
||||
fs.writeFile(path.join(__dirname,'..','..',"logs",timeStarted + ".log"), "[INFO]: Started logging...\n",
|
||||
function (err, data) {
|
||||
if (err) return console.log(err);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue