Created
April 25, 2024 04:38
-
-
Save dbwodlf3/cc2da275db08c0a9f2f6b7d5e40840c8 to your computer and use it in GitHub Desktop.
Revisions
-
dbwodlf3 created this gist
Apr 25, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ import fs from "fs"; import util from "util"; const logFile = fs.createWriteStream('output.log', { flags: 'a' }); console.log = function (msg) { logFile.write(util.format(msg) + '\n'); // 메시지를 파일에 쓰기 process.stdout.write(util.format(msg) + '\n'); // 표준 출력에도 쓰기 };