Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinajs/log-common

Package Overview
Dependencies
Maintainers
1
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/log-common - npm Package Compare versions

Comparing version 1.2.79 to 1.2.81

25

lib/index.d.ts

@@ -0,1 +1,2 @@

import { SyncModule } from "@spinajs/di";
export declare enum LogLevel {

@@ -118,13 +119,2 @@ Security = 999,

maxArchiveFiles: number;
/**
* Buffer size for incoming log messages. Messages are stored in buffer before write to file.
*
* Default is 8kb
*/
bufferSize: number;
/**
* Time in ms after whitch flush will be forced. If set to 0 feature is disabled ( any data hangin in temp buffer will not be saved before it reaches bufferSize)
* Default time is 10s.
*/
flushTimeout: number;
};

@@ -145,3 +135,16 @@ }

}
export declare abstract class LogTarget<T extends ICommonTargetOptions> extends SyncModule {
HasError: boolean;
Error: Error | null | unknown;
Options: T;
constructor(options: T);
abstract write(data: ILogEntry): void;
}
export interface ILogTargetDesc {
instance: LogTarget<ICommonTargetOptions>;
options?: ITargetsOption;
rule: ILogRule;
}
export interface ILog {
Targets: ILogTargetDesc[];
trace(message: string, ...args: any[]): void;

@@ -148,0 +151,0 @@ trace(err: Error, message: string, ...args: any[]): void;

@@ -25,4 +25,9 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createLogMessageObject = exports.LogLevelStrings = exports.StrToLogLevel = exports.LogLevel = void 0;
exports.createLogMessageObject = exports.LogTarget = exports.LogLevelStrings = exports.StrToLogLevel = exports.LogLevel = void 0;
const di_1 = require("@spinajs/di");
const lodash_1 = __importDefault(require("lodash"));
const util = __importStar(require("util"));

@@ -60,2 +65,16 @@ var LogLevel;

};
class LogTarget extends di_1.SyncModule {
constructor(options) {
super();
this.HasError = false;
this.Error = null;
if (options) {
this.Options = lodash_1.default.merge(lodash_1.default.merge(this.Options, {
enabled: true,
layout: "${datetime} ${level} ${message} ${error} (${logger})",
}), options);
}
}
}
exports.LogTarget = LogTarget;
function createLogMessageObject(err, message, level, logger, variables, ...args) {

@@ -62,0 +81,0 @@ const sMsg = err instanceof Error ? message : err;

{
"version": "1.2.79",
"version": "1.2.81",
"description": "Log lib for all spinejs related libs",

@@ -42,3 +42,6 @@ "main": "lib/index.js",

},
"gitHead": "ae595f5daffb88372496b6e5bf38973f07e33683"
"gitHead": "dd58385e770069586eb8814a13365ce889d46b34",
"dependencies": {
"@spinajs/di": "^1.2.81"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc