@youpaichris/logger 6.0.0 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +2 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -8,8 +8,9 @@
8
8
  const fs = require('fs');
9
9
  const path = require('path');
10
10
 
11
+ let e = __filename.split("/");
11
12
 
12
- const logFilePath = path.join(__dirname, `${path.basename(path.dirname(__filename))}.log`);
13
+ const logFilePath = e.at(e.indexOf("node_modules") - 1) === 'logger' ? `log.log` : e.at(e.indexOf("node_modules") - 1) + `.log`;
13
14
  const logFile = fs.createWriteStream(logFilePath, {flags: 'a'});
14
15
 
15
16
  const __log = console.log;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@youpaichris/logger",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {