Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
e849e4508b | |||
f8f48d67e0 | |||
ed2b74d436 | |||
0caf48a734 | |||
c4d6402fd9 | |||
83bc0c512b | |||
102e8faf92 | |||
87da0f1169 | |||
b53c49ca28 | |||
47bde8b4f8 | |||
d71de485d6 | |||
964666902f | |||
d5d6d7bf79 | |||
02d10dd08c | |||
4062157544 | |||
a673844fb3 | |||
53248a3a3d | |||
0043a553a7 |
138
.gitlab-ci.yml
138
.gitlab-ci.yml
@ -1,138 +0,0 @@
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- .npmci_cache/
|
||||
key: '$CI_BUILD_STAGE'
|
||||
|
||||
stages:
|
||||
- security
|
||||
- test
|
||||
- release
|
||||
- metadata
|
||||
|
||||
# ====================
|
||||
# security stage
|
||||
# ====================
|
||||
mirror:
|
||||
stage: security
|
||||
script:
|
||||
- npmci git mirror
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
auditProductionDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --production --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=prod --production
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
auditDevDependencies:
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command npm config set registry https://registry.npmjs.org
|
||||
- npmci command npm audit --audit-level=high --only=dev
|
||||
tags:
|
||||
- docker
|
||||
allow_failure: true
|
||||
|
||||
# ====================
|
||||
# test stage
|
||||
# ====================
|
||||
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
testBuild:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci command npm run build
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci node install stable
|
||||
- npmci npm publish
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
# ====================
|
||||
# metadata stage
|
||||
# ====================
|
||||
codequality:
|
||||
stage: metadata
|
||||
allow_failure: true
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- lossless
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -2,28 +2,10 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "current file",
|
||||
"type": "node",
|
||||
"command": "npm test",
|
||||
"name": "Run npm test",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"${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"
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -3,10 +3,10 @@
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartlog",
|
||||
"shortDescription": "minimalistic distributed and extensible logging tool",
|
||||
"npmPackagename": "@pushrocks/smartlog",
|
||||
"description": "minimalistic distributed and extensible logging tool",
|
||||
"npmPackagename": "@push.rocks/smartlog",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks"
|
||||
}
|
||||
|
27747
package-lock.json
generated
27747
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartlog",
|
||||
"version": "2.0.41",
|
||||
"name": "@push.rocks/smartlog",
|
||||
"version": "3.0.4",
|
||||
"private": false,
|
||||
"description": "minimalistic distributed and extensible logging tool",
|
||||
"keywords": [
|
||||
@ -18,21 +18,20 @@
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild --web && tsbundle npm)",
|
||||
"format": "(gitzone format)"
|
||||
"format": "(gitzone format)",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.25",
|
||||
"@gitzone/tsbundle": "^1.0.80",
|
||||
"@gitzone/tsbundle": "^2.0.6",
|
||||
"@gitzone/tsrun": "^1.2.17",
|
||||
"@gitzone/tstest": "^1.0.54",
|
||||
"@pushrocks/tapbundle": "^3.2.14",
|
||||
"@types/node": "^16.0.0",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
"@gitzone/tstest": "^1.0.72",
|
||||
"@push.rocks/tapbundle": "^5.0.4",
|
||||
"@types/node": "^18.6.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/isounique": "^1.0.4",
|
||||
"@pushrocks/smartlog-interfaces": "^2.0.22"
|
||||
"@push.rocks/isounique": "^1.0.4",
|
||||
"@push.rocks/smartlog-interfaces": "^3.0.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
@ -48,5 +47,6 @@
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 chrome versions"
|
||||
]
|
||||
],
|
||||
"type": "module"
|
||||
}
|
||||
|
4606
pnpm-lock.yaml
generated
Normal file
4606
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartlog from '../ts/index';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartlog from '../ts/index.js';
|
||||
|
||||
let testConsoleLog: smartlog.ConsoleLog;
|
||||
let testSmartLog: smartlog.Smartlog;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as smartlog from '../ts/index';
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartlog from '../ts/index.js';
|
||||
|
||||
let testConsoleLog: smartlog.ConsoleLog;
|
||||
let testSmartLog: smartlog.Smartlog;
|
||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartlog',
|
||||
version: '3.0.4',
|
||||
description: 'minimalistic distributed and extensible logging tool'
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import * as plugins from './smartlog.plugins';
|
||||
import { ConsoleLog } from './smartlog.classes.consolelog';
|
||||
import { LogGroup } from './smartlog.classes.loggroup';
|
||||
import { Smartlog } from './smartlog.classes.smartlog';
|
||||
import * as plugins from './smartlog.plugins.js';
|
||||
import { ConsoleLog } from './smartlog.classes.consolelog.js';
|
||||
import { LogGroup } from './smartlog.classes.loggroup.js';
|
||||
import { Smartlog } from './smartlog.classes.smartlog.js';
|
||||
|
||||
export { ConsoleLog, LogGroup, Smartlog };
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smartlog.plugins';
|
||||
import * as plugins from './smartlog.plugins.js';
|
||||
|
||||
/**
|
||||
* a console log optimized for smartlog
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './smartlog.plugins';
|
||||
import { Smartlog } from './smartlog.classes.smartlog';
|
||||
import * as plugins from './smartlog.plugins.js';
|
||||
import { Smartlog } from './smartlog.classes.smartlog.js';
|
||||
|
||||
export class LogGroup {
|
||||
public smartlogRef: Smartlog;
|
||||
|
@ -1,21 +1,19 @@
|
||||
import * as plugins from './smartlog.plugins';
|
||||
|
||||
import { ILogDestination, ILogPackage } from '@pushrocks/smartlog-interfaces';
|
||||
import * as plugins from './smartlog.plugins.js';
|
||||
|
||||
export class LogRouter {
|
||||
/**
|
||||
* all log destinations
|
||||
*/
|
||||
private logDestinations: ILogDestination[] = [];
|
||||
private logDestinations: plugins.smartlogInterfaces.ILogDestination[] = [];
|
||||
|
||||
constructor() {}
|
||||
|
||||
public addLogDestination(logDestination: ILogDestination) {
|
||||
public addLogDestination(logDestination: plugins.smartlogInterfaces.ILogDestination) {
|
||||
this.logDestinations.push(logDestination);
|
||||
}
|
||||
|
||||
// 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) {
|
||||
await logDestination.handleLog(logPackageArg);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as plugins from './smartlog.plugins';
|
||||
import * as plugins from './smartlog.plugins.js';
|
||||
|
||||
import { LogRouter } from './smartlog.classes.logrouter';
|
||||
import { LogGroup } from '.';
|
||||
import { LogRouter } from './smartlog.classes.logrouter.js';
|
||||
import { LogGroup } from './smartlog.classes.loggroup.js';
|
||||
|
||||
export interface ISmartlogContructorOptions {
|
||||
logContext: plugins.smartlogInterfaces.ILogContext;
|
||||
@ -9,8 +9,8 @@ export interface ISmartlogContructorOptions {
|
||||
}
|
||||
|
||||
export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
private logContext: plugins.smartlogInterfaces.ILogContext;
|
||||
private minimumLogLevel: plugins.smartlogInterfaces.TLogLevel;
|
||||
public logContext: plugins.smartlogInterfaces.ILogContext;
|
||||
public minimumLogLevel: plugins.smartlogInterfaces.TLogLevel;
|
||||
|
||||
public uniInstanceId: string = plugins.isounique.uni();
|
||||
|
||||
@ -24,7 +24,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
|
||||
constructor(optionsArg: ISmartlogContructorOptions) {
|
||||
this.logContext = optionsArg.logContext;
|
||||
this.minimumLogLevel = optionsArg.minimumLogLevel;
|
||||
this.minimumLogLevel = optionsArg.minimumLogLevel || 'silly';
|
||||
}
|
||||
|
||||
// ============
|
||||
@ -40,10 +40,9 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
const write = process.stdout.write;
|
||||
process.stdout.write = (...args: any) => {
|
||||
const logString: string = args[0];
|
||||
if (!logString) {
|
||||
return;
|
||||
}
|
||||
if (!logString.startsWith('LOG') && typeof logString === 'string') {
|
||||
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);
|
||||
@ -51,7 +50,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
default:
|
||||
this.log('info', logString);
|
||||
}
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
// fileStream.write(args[0]);
|
||||
write.apply(process.stdout, args);
|
||||
@ -61,7 +60,7 @@ export class Smartlog implements plugins.smartlogInterfaces.ILogDestination {
|
||||
process.stderr.write = (...args: any) => {
|
||||
if (!args[0].startsWith('LOG')) {
|
||||
this.log('error', args[0]);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
// fileStream.write(args[0]);
|
||||
write.apply(process.stderr, args);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as isounique from '@pushrocks/isounique';
|
||||
import * as smartlogInterfaces from '@pushrocks/smartlog-interfaces';
|
||||
import * as isounique from '@push.rocks/isounique';
|
||||
import * as smartlogInterfaces from '@push.rocks/smartlog-interfaces';
|
||||
|
||||
export { isounique, smartlogInterfaces };
|
||||
|
17
tslint.json
17
tslint.json
@ -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"
|
||||
}
|
Reference in New Issue
Block a user