Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
4062157544 | |||
a673844fb3 | |||
53248a3a3d | |||
0043a553a7 | |||
13981404f3 | |||
db951d1877 | |||
26c84b3a04 | |||
b3d8cf68f1 | |||
60ae0fed4e | |||
a03e821c02 | |||
592178f066 | |||
260af690ff |
@ -36,6 +36,7 @@ auditProductionDependencies:
|
|||||||
- npmci command npm audit --audit-level=high --only=prod --production
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
auditDevDependencies:
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
21856
package-lock.json
generated
21856
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartlog",
|
"name": "@pushrocks/smartlog",
|
||||||
"version": "2.0.37",
|
"version": "2.0.43",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "minimalistic distributed and extensible logging tool",
|
"description": "minimalistic distributed and extensible logging tool",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@ -21,18 +21,18 @@
|
|||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
"@gitzone/tsbundle": "^1.0.72",
|
"@gitzone/tsbundle": "^1.0.80",
|
||||||
"@gitzone/tsrun": "^1.2.12",
|
"@gitzone/tsrun": "^1.2.17",
|
||||||
"@gitzone/tstest": "^1.0.43",
|
"@gitzone/tstest": "^1.0.54",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^3.2.14",
|
||||||
"@types/node": "^14.0.27",
|
"@types/node": "^16.0.0",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/isounique": "^1.0.4",
|
"@pushrocks/isounique": "^1.0.4",
|
||||||
"@pushrocks/smartlog-interfaces": "^2.0.20"
|
"@pushrocks/smartlog-interfaces": "^2.0.22"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
@ -35,6 +35,39 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
|||||||
* enables console logging
|
* enables console logging
|
||||||
*/
|
*/
|
||||||
public enableConsole(optionsArg?: { captureAll: boolean }) {
|
public enableConsole(optionsArg?: { captureAll: boolean }) {
|
||||||
|
if (globalThis.process && optionsArg && optionsArg.captureAll) {
|
||||||
|
const process = globalThis.process;
|
||||||
|
const write = process.stdout.write;
|
||||||
|
process.stdout.write = (...args: any) => {
|
||||||
|
const logString: string = args[0];
|
||||||
|
if (!logString || typeof logString.startsWith !== 'function') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!logString.startsWith('LOG') && typeof logString === 'string') {
|
||||||
|
switch (true) {
|
||||||
|
case logString.substr(0, 20).includes('Error:'):
|
||||||
|
this.log('error', logString);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.log('info', logString);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// fileStream.write(args[0]);
|
||||||
|
write.apply(process.stdout, args);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
process.stderr.write = (...args: any) => {
|
||||||
|
if (!args[0].startsWith('LOG')) {
|
||||||
|
this.log('error', args[0]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// fileStream.write(args[0]);
|
||||||
|
write.apply(process.stderr, args);
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
this.consoleEnabled = true;
|
this.consoleEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user