@youpaichris/logger 6.0.3 → 6.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/package.json +1 -1
    
        package/index.js
    CHANGED
    
    | @@ -13,8 +13,8 @@ let e = __filename.split("/"); | |
| 13 13 | 
             
            const logFilePath = e.at(e.indexOf("node_modules") - 1) === 'logger' ? `log.log` : e.at(e.indexOf("node_modules") - 1) + `.log`;
         | 
| 14 14 | 
             
            const logFile = fs.createWriteStream(logFilePath, {flags: 'a'});
         | 
| 15 15 |  | 
| 16 | 
            -
            const  | 
| 17 | 
            -
            const  | 
| 16 | 
            +
            const successFilePath = e.at(e.indexOf("node_modules") - 1) === 'logger' ? `success.log` : e.at(e.indexOf("node_modules") - 1) + `-success.log`;
         | 
| 17 | 
            +
            const successFile = fs.createWriteStream(successFilePath, {flags: 'a'});
         | 
| 18 18 |  | 
| 19 19 | 
             
            const errorFilePath = e.at(e.indexOf("node_modules") - 1) === 'logger' ? `error.log` : e.at(e.indexOf("node_modules") - 1) + `-error.log`;
         | 
| 20 20 | 
             
            const errorFile = fs.createWriteStream(errorFilePath, {flags: 'a'});
         | 
| @@ -206,7 +206,7 @@ class Logger { | |
| 206 206 | 
             
                    if (this.save) {
         | 
| 207 207 | 
             
                        let _msg = `${dateFormat("YYYY-mm-dd HH:MM:SS.ms", new loggerConfig.Date())} | SUCCESS | ${pathLine.padEnd(22, " ")}${[...msg]}` + '\n';
         | 
| 208 208 | 
             
                        logFile.write(_msg);
         | 
| 209 | 
            -
                         | 
| 209 | 
            +
                        successFile.write(_msg);
         | 
| 210 210 | 
             
                    }
         | 
| 211 211 |  | 
| 212 212 |  |