Compare commits

..

24 Commits

Author SHA1 Message Date
ed2b74d436 3.0.3 2023-07-12 19:21:37 +02:00
0caf48a734 fix(core): update 2023-07-12 19:21:36 +02:00
c4d6402fd9 switch to new org scheme 2023-07-11 00:57:32 +02:00
83bc0c512b switch to new org scheme 2023-07-10 02:56:58 +02:00
102e8faf92 3.0.2 2022-10-26 15:22:54 +02:00
87da0f1169 fix(core): update 2022-10-26 15:22:54 +02:00
b53c49ca28 3.0.1 2022-07-26 21:03:40 +02:00
47bde8b4f8 fix(core): update 2022-07-26 21:03:39 +02:00
d71de485d6 3.0.0 2022-06-26 10:35:35 +02:00
964666902f BREAKING CHANGE(core): switch to esm 2022-06-26 10:35:35 +02:00
d5d6d7bf79 2.0.44 2021-07-21 02:25:22 +02:00
02d10dd08c fix(core): update 2021-07-21 02:25:22 +02:00
4062157544 2.0.43 2021-07-21 01:48:20 +02:00
a673844fb3 fix(core): update 2021-07-21 01:48:20 +02:00
53248a3a3d 2.0.42 2021-07-20 21:30:59 +02:00
0043a553a7 fix(core): update 2021-07-20 21:30:59 +02:00
13981404f3 2.0.41 2021-07-20 21:23:05 +02:00
db951d1877 fix(core): update 2021-07-20 21:23:05 +02:00
26c84b3a04 2.0.40 2021-07-06 19:26:36 +02:00
b3d8cf68f1 fix(core): update 2021-07-06 19:26:35 +02:00
60ae0fed4e 2.0.39 2020-09-08 12:57:25 +00:00
a03e821c02 fix(core): update 2020-09-08 12:57:24 +00:00
592178f066 2.0.38 2020-09-07 23:51:41 +00:00
260af690ff fix(core): update 2020-09-07 23:51:40 +00:00
16 changed files with 4696 additions and 11121 deletions

View File

@ -12,6 +12,9 @@ stages:
- release - release
- metadata - metadata
before_script:
- npm install -g @shipzone/npmci
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
@ -36,6 +39,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
@ -96,10 +100,9 @@ codequality:
only: only:
- tags - tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- lossless - lossless
- docker - docker
@ -119,11 +122,10 @@ trigger:
pages: pages:
stage: metadata stage: metadata
script: script:
- npmci node install lts - npmci node install stable
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless - lossless
- docker - docker

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

View File

@ -3,10 +3,10 @@
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "push.rocks",
"gitrepo": "smartlog", "gitrepo": "smartlog",
"shortDescription": "minimalistic distributed and extensible logging tool", "description": "minimalistic distributed and extensible logging tool",
"npmPackagename": "@pushrocks/smartlog", "npmPackagename": "@push.rocks/smartlog",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "projectDomain": "push.rocks"
} }

11036
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartlog", "name": "@push.rocks/smartlog",
"version": "2.0.37", "version": "3.0.3",
"private": false, "private": false,
"description": "minimalistic distributed and extensible logging tool", "description": "minimalistic distributed and extensible logging tool",
"keywords": [ "keywords": [
@ -18,21 +18,20 @@
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild --web && tsbundle npm)", "build": "(tsbuild --web && tsbundle npm)",
"format": "(gitzone format)" "format": "(gitzone format)",
"buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.72", "@gitzone/tsbundle": "^2.0.6",
"@gitzone/tsrun": "^1.2.12", "@gitzone/tsrun": "^1.2.17",
"@gitzone/tstest": "^1.0.43", "@gitzone/tstest": "^1.0.72",
"@pushrocks/tapbundle": "^3.2.9", "@push.rocks/tapbundle": "^5.0.4",
"@types/node": "^14.0.27", "@types/node": "^18.6.1"
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/isounique": "^1.0.4", "@push.rocks/isounique": "^1.0.4",
"@pushrocks/smartlog-interfaces": "^2.0.20" "@push.rocks/smartlog-interfaces": "^3.0.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@ -48,5 +47,6 @@
], ],
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ],
"type": "module"
} }

4606
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@push.rocks/tapbundle';
import * as smartlog from '../ts/index'; import * as smartlog from '../ts/index.js';
let testConsoleLog: smartlog.ConsoleLog; let testConsoleLog: smartlog.ConsoleLog;
let testSmartLog: smartlog.Smartlog; let testSmartLog: smartlog.Smartlog;

View File

@ -1,5 +1,5 @@
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@push.rocks/tapbundle';
import * as smartlog from '../ts/index'; import * as smartlog from '../ts/index.js';
let testConsoleLog: smartlog.ConsoleLog; let testConsoleLog: smartlog.ConsoleLog;
let testSmartLog: smartlog.Smartlog; let testSmartLog: smartlog.Smartlog;

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartlog',
version: '3.0.3',
description: 'minimalistic distributed and extensible logging tool'
}

View File

@ -1,6 +1,6 @@
import * as plugins from './smartlog.plugins'; import * as plugins from './smartlog.plugins.js';
import { ConsoleLog } from './smartlog.classes.consolelog'; import { ConsoleLog } from './smartlog.classes.consolelog.js';
import { LogGroup } from './smartlog.classes.loggroup'; import { LogGroup } from './smartlog.classes.loggroup.js';
import { Smartlog } from './smartlog.classes.smartlog'; import { Smartlog } from './smartlog.classes.smartlog.js';
export { ConsoleLog, LogGroup, Smartlog }; export { ConsoleLog, LogGroup, Smartlog };

View File

@ -1,4 +1,4 @@
import * as plugins from './smartlog.plugins'; import * as plugins from './smartlog.plugins.js';
/** /**
* a console log optimized for smartlog * a console log optimized for smartlog

View File

@ -1,5 +1,5 @@
import * as plugins from './smartlog.plugins'; import * as plugins from './smartlog.plugins.js';
import { Smartlog } from './smartlog.classes.smartlog'; import { Smartlog } from './smartlog.classes.smartlog.js';
export class LogGroup { export class LogGroup {
public smartlogRef: Smartlog; public smartlogRef: Smartlog;

View File

@ -1,21 +1,19 @@
import * as plugins from './smartlog.plugins'; import * as plugins from './smartlog.plugins.js';
import { ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces';
export class LogRouter { export class LogRouter {
/** /**
* all log destinations * all log destinations
*/ */
private logDestinations: ILogDestination[] = []; private logDestinations: plugins.smartlogInterfaces.ILogDestination[] = [];
constructor() {} constructor() {}
public addLogDestination(logDestination: ILogDestination) { public addLogDestination(logDestination: plugins.smartlogInterfaces.ILogDestination) {
this.logDestinations.push(logDestination); this.logDestinations.push(logDestination);
} }
// routes the log according to added logDestinations // routes the log according to added logDestinations
public async routeLog(logPackageArg: ILogPackage) { public async routeLog(logPackageArg: plugins.smartlogInterfaces.ILogPackage) {
for (const logDestination of this.logDestinations) { for (const logDestination of this.logDestinations) {
await logDestination.handleLog(logPackageArg); await logDestination.handleLog(logPackageArg);
} }

View File

@ -1,7 +1,7 @@
import * as plugins from './smartlog.plugins'; import * as plugins from './smartlog.plugins.js';
import { LogRouter } from './smartlog.classes.logrouter'; import { LogRouter } from './smartlog.classes.logrouter.js';
import { LogGroup } from '.'; import { LogGroup } from './smartlog.classes.loggroup.js';
export interface ISmartlogContructorOptions { export interface ISmartlogContructorOptions {
logContext: plugins.smartlogInterfaces.ILogContext; logContext: plugins.smartlogInterfaces.ILogContext;
@ -9,8 +9,8 @@ export interface ISmartlogContructorOptions {
} }
export class Smartlog implements plugins.smartlogInterfaces.ILogDestination { export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
private logContext: plugins.smartlogInterfaces.ILogContext; public logContext: plugins.smartlogInterfaces.ILogContext;
private minimumLogLevel: plugins.smartlogInterfaces.TLogLevel; public minimumLogLevel: plugins.smartlogInterfaces.TLogLevel;
public uniInstanceId: string = plugins.isounique.uni(); public uniInstanceId: string = plugins.isounique.uni();
@ -24,7 +24,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
constructor(optionsArg: ISmartlogContructorOptions) { constructor(optionsArg: ISmartlogContructorOptions) {
this.logContext = optionsArg.logContext; this.logContext = optionsArg.logContext;
this.minimumLogLevel = optionsArg.minimumLogLevel; this.minimumLogLevel = optionsArg.minimumLogLevel || 'silly';
} }
// ============ // ============
@ -35,6 +35,38 @@ 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') {
// lets continue as planned
} else 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 true;
}
// 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 true;
}
// fileStream.write(args[0]);
write.apply(process.stderr, args);
return true;
};
}
this.consoleEnabled = true; this.consoleEnabled = true;
} }

View File

@ -1,4 +1,4 @@
import * as isounique from '@pushrocks/isounique'; import * as isounique from '@push.rocks/isounique';
import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces'; import * as smartlogInterfaces from '@push.rocks/smartlog-interfaces';
export { isounique, smartlogInterfaces }; export { isounique, smartlogInterfaces };

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}