(data)
| 111 | |
| 112 | // This function is used to write the data into the log file |
| 113 | export const writeServerLog = (data) => { |
| 114 | data = data + '\n'; |
| 115 | if (fs.existsSync(serverLogFile)) { |
| 116 | fs.writeFileSync(serverLogFile, data, {flag: 'a+'}); |
| 117 | } else { |
| 118 | fs.writeFileSync(serverLogFile, data, {flag: 'w'}); |
| 119 | } |
| 120 | }; |
| 121 | |
| 122 | // This function is used to remove the log file |
| 123 | const removeLogFile = () => { |