thinkncollab-shell 0.0.7 → 0.0.9

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.
@@ -1,5 +1,4 @@
1
- /**
2
- * Logger for ThinkNCollab Shell
1
+ /* Logger for ThinkNCollab Shell
3
2
  */
4
3
 
5
4
  const fs = require('fs-extra');
@@ -29,16 +28,14 @@ class Logger {
29
28
  this.currentLogFile = this.getLogFileName();
30
29
  }
31
30
 
32
- /**
33
- * Get log file name
31
+ /* Get log file name
34
32
  */
35
33
  getLogFileName() {
36
34
  const date = new Date().toISOString().split('T')[0];
37
35
  return path.join(this.options.logDir, `thinknsh-${date}.log`);
38
36
  }
39
37
 
40
- /**
41
- * Write to log file
38
+ /* Write to log file
42
39
  */
43
40
  async write(level, message, data = null) {
44
41
  if (this.levels[level] < this.levels[this.options.level]) {
@@ -63,8 +60,7 @@ class Logger {
63
60
  }
64
61
  }
65
62
 
66
- /**
67
- * Rotate log files if needed
63
+ /* Rotate log files if needed
68
64
  */
69
65
  async rotateIfNeeded() {
70
66
  try {
@@ -87,8 +83,7 @@ class Logger {
87
83
  }
88
84
  }
89
85
 
90
- /**
91
- * Clean old log files
86
+ /* Clean old log files
92
87
  */
93
88
  async cleanOldLogs() {
94
89
  try {
@@ -114,36 +109,31 @@ class Logger {
114
109
  }
115
110
  }
116
111
 
117
- /**
118
- * Debug log
112
+ /* Debug log
119
113
  */
120
114
  debug(message, data = null) {
121
115
  return this.write('debug', message, data);
122
116
  }
123
117
 
124
- /**
125
- * Info log
118
+ /* Info log
126
119
  */
127
120
  info(message, data = null) {
128
121
  return this.write('info', message, data);
129
122
  }
130
123
 
131
- /**
132
- * Warn log
124
+ /* Warn log
133
125
  */
134
126
  warn(message, data = null) {
135
127
  return this.write('warn', message, data);
136
128
  }
137
129
 
138
- /**
139
- * Error log
130
+ /* Error log
140
131
  */
141
132
  error(message, data = null) {
142
133
  return this.write('error', message, data);
143
134
  }
144
135
 
145
- /**
146
- * Get recent logs
136
+ /* Get recent logs
147
137
  */
148
138
  async getRecentLogs(lines = 100) {
149
139
  try {