@nu-art/commando 0.204.95 → 0.204.96
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/package.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
/// <reference types="node" />
|
|
7
7
|
import { Logger } from '@nu-art/ts-common';
|
|
8
8
|
import { LogTypes } from '../types';
|
|
9
|
+
type LogProcessor = (log: string, std: LogTypes) => boolean;
|
|
9
10
|
export declare class InteractiveShell extends Logger {
|
|
10
11
|
private _debug;
|
|
11
12
|
private logProcessors;
|
|
@@ -47,13 +48,13 @@ export declare class InteractiveShell extends Logger {
|
|
|
47
48
|
* @param {(log: string, std: LogTypes) => boolean} processor - The log processor function.
|
|
48
49
|
* @returns {this} - The InteractiveShell instance for method chaining.
|
|
49
50
|
*/
|
|
50
|
-
addLogProcessor(processor:
|
|
51
|
+
addLogProcessor(processor: LogProcessor): this;
|
|
51
52
|
/**
|
|
52
53
|
* Removes a log processor from handling log messages.
|
|
53
54
|
* @param {(log: string, std: LogTypes) => boolean} processor - The log processor function to remove.
|
|
54
55
|
* @returns {this} - The InteractiveShell instance for method chaining.
|
|
55
56
|
*/
|
|
56
|
-
removeLogProcessor(processor:
|
|
57
|
+
removeLogProcessor(processor: LogProcessor): this;
|
|
57
58
|
/**
|
|
58
59
|
* Sets a unique identifier for the shell session.
|
|
59
60
|
* @param {string} uid - The unique identifier.
|
|
@@ -61,3 +62,4 @@ export declare class InteractiveShell extends Logger {
|
|
|
61
62
|
*/
|
|
62
63
|
setUID(uid: string): this;
|
|
63
64
|
}
|
|
65
|
+
export {};
|
|
@@ -86,7 +86,10 @@ class InteractiveShell extends ts_common_1.Logger {
|
|
|
86
86
|
return toPrint && filter;
|
|
87
87
|
}, true);
|
|
88
88
|
if (toPrint)
|
|
89
|
-
|
|
89
|
+
if (std === 'out')
|
|
90
|
+
this.logInfo(`${message}`);
|
|
91
|
+
else
|
|
92
|
+
this.logError(`${message}`);
|
|
90
93
|
}
|
|
91
94
|
catch (e) {
|
|
92
95
|
this.logError(e);
|