hereya-cli 0.22.0 → 0.23.0
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/README.md +20 -20
- package/dist/commands/add/index.js +5 -3
- package/dist/commands/deploy/index.js +4 -3
- package/dist/commands/down/index.js +4 -3
- package/dist/commands/remove/index.js +4 -3
- package/dist/commands/undeploy/index.js +4 -3
- package/dist/commands/up/index.js +4 -3
- package/dist/commands/workspace/install/index.js +4 -3
- package/dist/commands/workspace/uninstall/index.js +4 -3
- package/dist/lib/log.d.ts +2 -0
- package/dist/lib/log.js +17 -19
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g hereya-cli
|
|
|
20
20
|
$ hereya COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ hereya (--version)
|
|
23
|
-
hereya-cli/0.
|
|
23
|
+
hereya-cli/0.23.0 linux-x64 node-v22.13.1
|
|
24
24
|
$ hereya --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ hereya COMMAND
|
|
@@ -81,7 +81,7 @@ EXAMPLES
|
|
|
81
81
|
$ hereya add cloudy/docker_postgres
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
84
|
+
_See code: [src/commands/add/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/add/index.ts)_
|
|
85
85
|
|
|
86
86
|
## `hereya bootstrap INFRASTRUCTURETYPE`
|
|
87
87
|
|
|
@@ -106,7 +106,7 @@ EXAMPLES
|
|
|
106
106
|
$ hereya bootstrap local
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
109
|
+
_See code: [src/commands/bootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/bootstrap/index.ts)_
|
|
110
110
|
|
|
111
111
|
## `hereya deploy`
|
|
112
112
|
|
|
@@ -131,7 +131,7 @@ EXAMPLES
|
|
|
131
131
|
$ hereya deploy
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
134
|
+
_See code: [src/commands/deploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/deploy/index.ts)_
|
|
135
135
|
|
|
136
136
|
## `hereya down`
|
|
137
137
|
|
|
@@ -157,7 +157,7 @@ EXAMPLES
|
|
|
157
157
|
$ hereya down
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
160
|
+
_See code: [src/commands/down/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/down/index.ts)_
|
|
161
161
|
|
|
162
162
|
## `hereya env [NAME]`
|
|
163
163
|
|
|
@@ -188,7 +188,7 @@ EXAMPLES
|
|
|
188
188
|
$ hereya env -w dev -l
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
191
|
+
_See code: [src/commands/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/env/index.ts)_
|
|
192
192
|
|
|
193
193
|
## `hereya env set [NAME]`
|
|
194
194
|
|
|
@@ -215,7 +215,7 @@ EXAMPLES
|
|
|
215
215
|
$ hereya env set FOO -v bar -w dev
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
218
|
+
_See code: [src/commands/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/env/set/index.ts)_
|
|
219
219
|
|
|
220
220
|
## `hereya help [COMMAND]`
|
|
221
221
|
|
|
@@ -261,7 +261,7 @@ EXAMPLES
|
|
|
261
261
|
$ hereya init myProject -w=defaultWorkspace --chdir=./myProject
|
|
262
262
|
```
|
|
263
263
|
|
|
264
|
-
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
264
|
+
_See code: [src/commands/init/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/init/index.ts)_
|
|
265
265
|
|
|
266
266
|
## `hereya remove PACKAGE`
|
|
267
267
|
|
|
@@ -288,7 +288,7 @@ EXAMPLES
|
|
|
288
288
|
$ hereya remove cloudy/docker_postgres
|
|
289
289
|
```
|
|
290
290
|
|
|
291
|
-
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
291
|
+
_See code: [src/commands/remove/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/remove/index.ts)_
|
|
292
292
|
|
|
293
293
|
## `hereya run CMD`
|
|
294
294
|
|
|
@@ -314,7 +314,7 @@ EXAMPLES
|
|
|
314
314
|
$ hereya run -w uat -- node index.js
|
|
315
315
|
```
|
|
316
316
|
|
|
317
|
-
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
317
|
+
_See code: [src/commands/run/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/run/index.ts)_
|
|
318
318
|
|
|
319
319
|
## `hereya unbootstrap INFRASTRUCTURETYPE`
|
|
320
320
|
|
|
@@ -339,7 +339,7 @@ EXAMPLES
|
|
|
339
339
|
$ hereya unbootstrap local
|
|
340
340
|
```
|
|
341
341
|
|
|
342
|
-
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
342
|
+
_See code: [src/commands/unbootstrap/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/unbootstrap/index.ts)_
|
|
343
343
|
|
|
344
344
|
## `hereya undeploy`
|
|
345
345
|
|
|
@@ -364,7 +364,7 @@ EXAMPLES
|
|
|
364
364
|
$ hereya undeploy
|
|
365
365
|
```
|
|
366
366
|
|
|
367
|
-
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
367
|
+
_See code: [src/commands/undeploy/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/undeploy/index.ts)_
|
|
368
368
|
|
|
369
369
|
## `hereya up`
|
|
370
370
|
|
|
@@ -390,7 +390,7 @@ EXAMPLES
|
|
|
390
390
|
$ hereya up
|
|
391
391
|
```
|
|
392
392
|
|
|
393
|
-
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
393
|
+
_See code: [src/commands/up/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/up/index.ts)_
|
|
394
394
|
|
|
395
395
|
## `hereya workspace create NAME`
|
|
396
396
|
|
|
@@ -410,7 +410,7 @@ EXAMPLES
|
|
|
410
410
|
$ hereya workspace create dev
|
|
411
411
|
```
|
|
412
412
|
|
|
413
|
-
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
413
|
+
_See code: [src/commands/workspace/create/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/create/index.ts)_
|
|
414
414
|
|
|
415
415
|
## `hereya workspace delete NAME`
|
|
416
416
|
|
|
@@ -430,7 +430,7 @@ EXAMPLES
|
|
|
430
430
|
$ hereya workspace delete dev
|
|
431
431
|
```
|
|
432
432
|
|
|
433
|
-
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
433
|
+
_See code: [src/commands/workspace/delete/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/delete/index.ts)_
|
|
434
434
|
|
|
435
435
|
## `hereya workspace env [NAME]`
|
|
436
436
|
|
|
@@ -456,7 +456,7 @@ EXAMPLES
|
|
|
456
456
|
$ hereya workspace env myEnv -w dev
|
|
457
457
|
```
|
|
458
458
|
|
|
459
|
-
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
459
|
+
_See code: [src/commands/workspace/env/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/env/index.ts)_
|
|
460
460
|
|
|
461
461
|
## `hereya workspace env set`
|
|
462
462
|
|
|
@@ -480,7 +480,7 @@ EXAMPLES
|
|
|
480
480
|
$ hereya workspace env set -w my-workspace -n myVar -v my-value -i aws -s
|
|
481
481
|
```
|
|
482
482
|
|
|
483
|
-
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
483
|
+
_See code: [src/commands/workspace/env/set/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/env/set/index.ts)_
|
|
484
484
|
|
|
485
485
|
## `hereya workspace env unset`
|
|
486
486
|
|
|
@@ -501,7 +501,7 @@ EXAMPLES
|
|
|
501
501
|
$ hereya workspace env unset -w my-workspace -n myVar
|
|
502
502
|
```
|
|
503
503
|
|
|
504
|
-
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
504
|
+
_See code: [src/commands/workspace/env/unset/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/env/unset/index.ts)_
|
|
505
505
|
|
|
506
506
|
## `hereya workspace install PACKAGE`
|
|
507
507
|
|
|
@@ -528,7 +528,7 @@ EXAMPLES
|
|
|
528
528
|
$ hereya workspace install hereya/aws-cognito
|
|
529
529
|
```
|
|
530
530
|
|
|
531
|
-
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
531
|
+
_See code: [src/commands/workspace/install/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/install/index.ts)_
|
|
532
532
|
|
|
533
533
|
## `hereya workspace uninstall PACKAGE`
|
|
534
534
|
|
|
@@ -555,5 +555,5 @@ EXAMPLES
|
|
|
555
555
|
$ hereya workspace uninstall hereya/aws-cognito
|
|
556
556
|
```
|
|
557
557
|
|
|
558
|
-
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.
|
|
558
|
+
_See code: [src/commands/workspace/uninstall/index.ts](https://github.com/hereya/hereya-cli/blob/v0.23.0/src/commands/workspace/uninstall/index.ts)_
|
|
559
559
|
<!-- commandsstop -->
|
|
@@ -5,7 +5,7 @@ import { getExecutor } from '../../executor/index.js';
|
|
|
5
5
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
6
6
|
import { logEnv } from '../../lib/env-utils.js';
|
|
7
7
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
8
|
-
import { getLogger, isDebug, setDebug } from '../../lib/log.js';
|
|
8
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
|
|
9
9
|
import { arrayOfStringToObject } from '../../lib/object-utils.js';
|
|
10
10
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
11
11
|
import { delay } from '../../lib/shell.js';
|
|
@@ -168,8 +168,10 @@ export default class Add extends Command {
|
|
|
168
168
|
myLogger.log(ListrLogLevels.COMPLETED, 'Package added successfully');
|
|
169
169
|
}
|
|
170
170
|
catch (error) {
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
this.error(`${error.message}
|
|
172
|
+
|
|
173
|
+
See ${getLogPath()} for more details
|
|
174
|
+
`);
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
}
|
|
@@ -5,7 +5,7 @@ import { getBackend } from '../../backend/index.js';
|
|
|
5
5
|
import { getExecutor } from '../../executor/index.js';
|
|
6
6
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
7
7
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
8
|
-
import { getLogger, isDebug, setDebug } from '../../lib/log.js';
|
|
8
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
|
|
9
9
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
10
10
|
import { delay } from '../../lib/shell.js';
|
|
11
11
|
export default class Deploy extends Command {
|
|
@@ -322,8 +322,9 @@ export default class Deploy extends Command {
|
|
|
322
322
|
myLogger.log(ListrLogLevels.COMPLETED, 'Deployment completed successfully');
|
|
323
323
|
}
|
|
324
324
|
catch (error) {
|
|
325
|
-
|
|
326
|
-
|
|
325
|
+
this.error(`${error.message}
|
|
326
|
+
|
|
327
|
+
See ${getLogPath()} for more details`);
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
330
|
}
|
|
@@ -4,7 +4,7 @@ import { getBackend } from '../../backend/index.js';
|
|
|
4
4
|
import { getExecutor } from '../../executor/index.js';
|
|
5
5
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
6
6
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
7
|
-
import { getLogger, isDebug, setDebug } from '../../lib/log.js';
|
|
7
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
|
|
8
8
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
9
9
|
import { delay } from '../../lib/shell.js';
|
|
10
10
|
export default class Down extends Command {
|
|
@@ -158,8 +158,9 @@ export default class Down extends Command {
|
|
|
158
158
|
myLogger.log(ListrLogLevels.COMPLETED, 'Project shut down successfully');
|
|
159
159
|
}
|
|
160
160
|
catch (error) {
|
|
161
|
-
|
|
162
|
-
|
|
161
|
+
this.error(`${error.message}
|
|
162
|
+
|
|
163
|
+
See ${getLogPath()} for more details`);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
}
|
|
@@ -4,7 +4,7 @@ import { getBackend } from '../../backend/index.js';
|
|
|
4
4
|
import { getExecutor } from '../../executor/index.js';
|
|
5
5
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
6
6
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
7
|
-
import { getLogger, isDebug, setDebug } from '../../lib/log.js';
|
|
7
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
|
|
8
8
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
9
9
|
import { delay } from '../../lib/shell.js';
|
|
10
10
|
export default class Remove extends Command {
|
|
@@ -144,8 +144,9 @@ export default class Remove extends Command {
|
|
|
144
144
|
myLogger.log(ListrLogLevels.COMPLETED, 'Package removed successfully');
|
|
145
145
|
}
|
|
146
146
|
catch (error) {
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
this.error(`${error.message}
|
|
148
|
+
|
|
149
|
+
See ${getLogPath()} for more details`);
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
}
|
|
@@ -5,7 +5,7 @@ import { getBackend } from '../../backend/index.js';
|
|
|
5
5
|
import { getExecutor } from '../../executor/index.js';
|
|
6
6
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
7
7
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
8
|
-
import { getLogger, isDebug, setDebug } from '../../lib/log.js';
|
|
8
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
|
|
9
9
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
10
10
|
import { delay } from '../../lib/shell.js';
|
|
11
11
|
export default class Undeploy extends Command {
|
|
@@ -216,8 +216,9 @@ export default class Undeploy extends Command {
|
|
|
216
216
|
myLogger.log(ListrLogLevels.COMPLETED, 'Project undeployed successfully');
|
|
217
217
|
}
|
|
218
218
|
catch (error) {
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
this.error(`${error.message}
|
|
220
|
+
|
|
221
|
+
See ${getLogPath()} for more details`);
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
}
|
|
@@ -4,7 +4,7 @@ import { getBackend } from '../../backend/index.js';
|
|
|
4
4
|
import { getExecutor } from '../../executor/index.js';
|
|
5
5
|
import { getConfigManager } from '../../lib/config/index.js';
|
|
6
6
|
import { getEnvManager } from '../../lib/env/index.js';
|
|
7
|
-
import { getLogger, isDebug, setDebug } from '../../lib/log.js';
|
|
7
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../lib/log.js';
|
|
8
8
|
import { getParameterManager } from '../../lib/parameter/index.js';
|
|
9
9
|
import { delay } from '../../lib/shell.js';
|
|
10
10
|
export default class Up extends Command {
|
|
@@ -230,8 +230,9 @@ export default class Up extends Command {
|
|
|
230
230
|
myLogger.log(ListrLogLevels.COMPLETED, 'Project waked up successfully');
|
|
231
231
|
}
|
|
232
232
|
catch (error) {
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
this.error(`${error.message}
|
|
234
|
+
|
|
235
|
+
See ${getLogPath()} for more details`);
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
238
|
}
|
|
@@ -2,7 +2,7 @@ import { Args, Command, Flags } from '@oclif/core';
|
|
|
2
2
|
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import { getBackend } from '../../../backend/index.js';
|
|
4
4
|
import { getExecutor } from '../../../executor/index.js';
|
|
5
|
-
import { getLogger, isDebug, setDebug } from '../../../lib/log.js';
|
|
5
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../../lib/log.js';
|
|
6
6
|
import { arrayOfStringToObject } from '../../../lib/object-utils.js';
|
|
7
7
|
import { delay } from '../../../lib/shell.js';
|
|
8
8
|
import { load } from '../../../lib/yaml-utils.js';
|
|
@@ -123,8 +123,9 @@ export default class WorkspaceInstall extends Command {
|
|
|
123
123
|
myLogger.log(ListrLogLevels.COMPLETED, `Package ${args.package} installed successfully into workspace ${flags.workspace}`);
|
|
124
124
|
}
|
|
125
125
|
catch (error) {
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
this.error(`${error.message}
|
|
127
|
+
|
|
128
|
+
See ${getLogPath()} for more details`);
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
131
|
}
|
|
@@ -2,7 +2,7 @@ import { Args, Command, Flags } from '@oclif/core';
|
|
|
2
2
|
import { Listr, ListrLogger, ListrLogLevels } from 'listr2';
|
|
3
3
|
import { getBackend } from '../../../backend/index.js';
|
|
4
4
|
import { getExecutor } from '../../../executor/index.js';
|
|
5
|
-
import { getLogger, isDebug, setDebug } from '../../../lib/log.js';
|
|
5
|
+
import { getLogger, getLogPath, isDebug, setDebug } from '../../../lib/log.js';
|
|
6
6
|
import { arrayOfStringToObject } from '../../../lib/object-utils.js';
|
|
7
7
|
import { delay } from '../../../lib/shell.js';
|
|
8
8
|
import { load } from '../../../lib/yaml-utils.js';
|
|
@@ -129,8 +129,9 @@ export default class WorkspaceUninstall extends Command {
|
|
|
129
129
|
myLogger.log(ListrLogLevels.COMPLETED, `Package ${args.package} uninstalled successfully from workspace ${flags.workspace}`);
|
|
130
130
|
}
|
|
131
131
|
catch (error) {
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
this.error(`${error.message}
|
|
133
|
+
|
|
134
|
+
See ${getLogPath()} for more details`);
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
}
|
package/dist/lib/log.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ListrTaskWrapper } from 'listr2';
|
|
2
2
|
export declare function setDebug(value: boolean): void;
|
|
3
3
|
export declare function isDebug(): boolean;
|
|
4
|
+
export declare function getLogPath(): string;
|
|
4
5
|
export declare function getLogger(task: ListrTaskWrapper<any, any, any>): {
|
|
5
6
|
debug(message: string): void;
|
|
6
7
|
error(message: string): void;
|
|
@@ -11,6 +12,7 @@ export declare function getDefaultLogger(): {
|
|
|
11
12
|
error(message: string): void;
|
|
12
13
|
info(message: string): void;
|
|
13
14
|
};
|
|
15
|
+
export declare function logFileName(): string;
|
|
14
16
|
export interface Logger {
|
|
15
17
|
debug(message: string): void;
|
|
16
18
|
error(message: string): void;
|
package/dist/lib/log.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
import { stripVTControlCharacters } from 'node:util';
|
|
4
5
|
let debug = false;
|
|
@@ -8,56 +9,53 @@ export function setDebug(value) {
|
|
|
8
9
|
export function isDebug() {
|
|
9
10
|
return debug;
|
|
10
11
|
}
|
|
11
|
-
const logPath = path.resolve(
|
|
12
|
+
const logPath = path.resolve(os.tmpdir(), logFileName());
|
|
13
|
+
export function getLogPath() {
|
|
14
|
+
return logPath;
|
|
15
|
+
}
|
|
12
16
|
export function getLogger(task) {
|
|
13
|
-
|
|
14
|
-
if (isDebug()) {
|
|
15
|
-
logFile = fs.createWriteStream(logPath, { encoding: 'utf8', flags: 'a' });
|
|
16
|
-
}
|
|
17
|
+
const logFile = fs.createWriteStream(logPath, { encoding: 'utf8', flags: 'a' });
|
|
17
18
|
return {
|
|
18
19
|
debug(message) {
|
|
19
20
|
if (isDebug()) {
|
|
20
21
|
task.output = message;
|
|
21
|
-
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
22
22
|
}
|
|
23
|
+
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
23
24
|
},
|
|
24
25
|
error(message) {
|
|
25
26
|
task.output = message;
|
|
26
|
-
|
|
27
|
-
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
28
|
-
}
|
|
27
|
+
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
29
28
|
},
|
|
30
29
|
info(message) {
|
|
31
30
|
task.output = message;
|
|
32
|
-
|
|
33
|
-
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
34
|
-
}
|
|
31
|
+
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
35
32
|
},
|
|
36
33
|
};
|
|
37
34
|
}
|
|
38
35
|
export function getDefaultLogger() {
|
|
39
|
-
|
|
40
|
-
if (isDebug()) {
|
|
41
|
-
logFile = fs.createWriteStream(logPath, { encoding: 'utf8', flags: 'a' });
|
|
42
|
-
}
|
|
36
|
+
const logFile = fs.createWriteStream(logPath, { encoding: 'utf8', flags: 'a' });
|
|
43
37
|
return {
|
|
44
38
|
debug(message) {
|
|
45
39
|
if (isDebug()) {
|
|
46
40
|
console.debug(message);
|
|
47
|
-
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
48
41
|
}
|
|
42
|
+
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
49
43
|
},
|
|
50
44
|
error(message) {
|
|
51
45
|
if (isDebug()) {
|
|
52
46
|
console.error(message);
|
|
53
|
-
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
54
47
|
}
|
|
48
|
+
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
55
49
|
},
|
|
56
50
|
info(message) {
|
|
57
51
|
if (isDebug()) {
|
|
58
52
|
console.info(message);
|
|
59
|
-
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
60
53
|
}
|
|
54
|
+
logFile.write(stripVTControlCharacters(message), 'utf8');
|
|
61
55
|
},
|
|
62
56
|
};
|
|
63
57
|
}
|
|
58
|
+
export function logFileName() {
|
|
59
|
+
const date = new Date();
|
|
60
|
+
return `hereya-${date.toISOString().replaceAll(':', '_').replaceAll('.', '_')}-debug.log`;
|
|
61
|
+
}
|
package/oclif.manifest.json
CHANGED