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

@zodash/logger

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zodash/logger - npm Package Compare versions

Comparing version 0.2.32 to 1.0.1

31

CHANGELOG.md

@@ -6,2 +6,33 @@ # Change Log

## [1.0.1](https://github.com/zcorky/zodash/compare/@zodash/logger@0.3.0...@zodash/logger@1.0.1) (2022-08-25)
### Bug Fixes
* update logger version cause who used it to upgrade ([b0ec599](https://github.com/zcorky/zodash/commit/b0ec5996e134d6f3d36be76dbcc37ab28c469fdd))
# [0.3.0](https://github.com/zcorky/zodash/compare/@zodash/logger@0.2.33...@zodash/logger@0.3.0) (2022-08-24)
### Features
* **logger:** add queue ([be73bd8](https://github.com/zcorky/zodash/commit/be73bd82431ef2164bf064603c4cd48c3fb4cef9))
* **logger:** add queue ([c7d36bb](https://github.com/zcorky/zodash/commit/c7d36bb9dca3ad145bf07dc093b008604c5dff3b))
## [0.2.33](https://github.com/zcorky/zodash/compare/@zodash/logger@0.2.32...@zodash/logger@0.2.33) (2022-08-24)
**Note:** Version bump only for package @zodash/logger
## [0.2.32](https://github.com/zcorky/zodash/compare/@zodash/logger@0.2.31...@zodash/logger@0.2.32) (2022-07-22)

@@ -8,0 +39,0 @@

2

lib/logger.d.ts

@@ -26,2 +26,3 @@ import { Onion, Context, Middleware } from '@zodash/onion';

nameMinLength?: number;
queueMaxLength?: number;
}

@@ -59,4 +60,5 @@ export declare enum LogLevel {

setLogDir(logDir: string): void;
getQueue(): Promise<Input[]>;
}
export declare function getLogger(name: string, options?: Options): Logger;
export {};

@@ -7,2 +7,5 @@ "use strict";

const format_1 = require("@zodash/format");
// message queue to cache logs
// default length 1000
let queue = [];
var LogLevel;

@@ -119,3 +122,3 @@ (function (LogLevel) {

return async (ctx) => {
var _a, _b;
var _a, _b, _c;
const { input } = ctx;

@@ -129,3 +132,8 @@ if (this.options.console === false) {

: this.name.padEnd((_b = this.options) === null || _b === void 0 ? void 0 : _b.nameMinLength);
const queueMaxLength = ((_c = this.options) === null || _c === void 0 ? void 0 : _c.queueMaxLength) || 1000;
const message = this.getLogMessage(input.datetime, input.message, input.level);
queue.unshift(input);
if (queue.length > queueMaxLength) {
queue = queue.slice(0, 1000);
}
const isUseDevConsole = Array.isArray(message);

@@ -238,2 +246,5 @@ if (!isUseDevConsole) {

}
async getQueue() {
return queue;
}
}

@@ -240,0 +251,0 @@ exports.Logger = Logger;

8

package.json
{
"name": "@zodash/logger",
"version": "0.2.32",
"version": "1.0.1",
"description": "simple logger model",

@@ -70,6 +70,6 @@ "keywords": [

"@zcorky/moment": "^1.2.3",
"@zodash/format": "^1.3.1",
"@zodash/onion": "^0.1.8"
"@zodash/format": "^1.3.3",
"@zodash/onion": "^0.1.10"
},
"gitHead": "3467270f7e34778789129418c46d73266dd21ee5"
"gitHead": "8e4041bf31658631e9ab9159e2103186fdea44b9"
}
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