Skip to content

Commit 9b845a8

Browse files
committed
update log path
1 parent 8136c05 commit 9b845a8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

server/rmt_recorder.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,18 @@ const server = net.createServer((socket) => {
6464
const connCtx = new Map();
6565

6666
try {
67-
fs.mkdirSync(`${peerAddr}.log`);
67+
fs.mkdirSync(`${peerAddr}`);
68+
connCtx.set('path', `${peerAddr}/${dateTimeStampForFileName()}.log`);
6869
} catch (error) {
6970
//nothing todo
7071
}
7172

72-
connCtx.set('path', `${peerAddr}.log/${dateTimeStampForFileName()}.log`);
73-
7473
// create standalone log file for every day
7574
connCtx.set('timer', setInterval(() => {
7675
const oname = nodePath.basename(connCtx.get('path'));
7776
const nname = `${dateTimeStampForFileName()}.log`;
7877
if (oname != nname) {
79-
connCtx.set('path', `${peerAddr}.log/${nname}`);
78+
connCtx.set('path', `${peerAddr}/${nname}`);
8079
const oldStream = connCtx.get('outStream');
8180
if (oldStream) {
8281
connCtx.set('outStream', fs.createWriteStream(connCtx.get('path'), { flags: 'a' }));

0 commit comments

Comments
 (0)