Compare commits

...

18 Commits

Author SHA1 Message Date
e849e4508b 3.0.4 2023-08-08 18:01:36 +02:00
f8f48d67e0 fix(core): update 2023-08-08 18:01:35 +02:00
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
16 changed files with 4660 additions and 27969 deletions

View File

@ -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
View File

@ -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"
}
]
}

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -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
View 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'
}

View File

@ -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 };

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

View File

@ -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;

View File

@ -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);
}

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 { 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);

View File

@ -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 };

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"
}