File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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' } ) ) ;
You can’t perform that action at this time.
0 commit comments