mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(cloudcmd) writeLogsToFile
This commit is contained in:
parent
4c4ce704ba
commit
a1b8d0d536
1 changed files with 5 additions and 7 deletions
12
cloudcmd.js
12
cloudcmd.js
|
|
@ -343,13 +343,11 @@
|
|||
|
||||
|
||||
/* function sets stdout to file log.txt */
|
||||
function writeLogsToFile(){
|
||||
var stdo = fs.createWriteStream('./log.txt');
|
||||
function writeLogsToFile() {
|
||||
var stdout = process.stdout,
|
||||
writeFile = fs.createWriteStream('log.txt'),
|
||||
write = writeFile.write.bind(writeFile);
|
||||
|
||||
process.stdout.write = (function(write) {
|
||||
return function(string, encoding, fd) {
|
||||
stdo.write(string);
|
||||
};
|
||||
})(process.stdout.write);
|
||||
stdout.write = write;
|
||||
}
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue