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

@adonisjs/logger

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adonisjs/logger - npm Package Compare versions

Comparing version 5.2.0-0 to 5.3.0-0

4

build/test_factories/logger.d.ts

@@ -0,7 +1,11 @@

/// <reference types="node" resolution-mode="require"/>
import { Writable } from 'node:stream';
import { Logger } from '../src/logger.js';
import type { LoggerConfig } from '../src/types.js';
export declare function getFakeStream(fn: (line: string) => boolean): Writable;
export declare class LoggerFactory {
#private;
pushLogsTo(collection: string[]): this;
merge(options: LoggerConfig): this;
create(): Logger<LoggerConfig>;
}

@@ -0,4 +1,15 @@

import { Writable } from 'node:stream';
import { Logger } from '../src/logger.js';
export function getFakeStream(fn) {
const stream = new Writable();
stream.write = fn;
return stream;
}
export class LoggerFactory {
#options = {};
#logsCollection;
pushLogsTo(collection) {
this.#logsCollection = collection;
return this;
}
merge(options) {

@@ -9,4 +20,10 @@ Object.assign(this.#options, options);

create() {
if (this.#logsCollection) {
this.#options.desination = getFakeStream((message) => {
this.#logsCollection.push(message.trim());
return true;
});
}
return new Logger(this.#options);
}
}

14

package.json
{
"name": "@adonisjs/logger",
"version": "5.2.0-0",
"version": "5.3.0-0",
"description": "Logger built on top of pino to be used by AdonisJs",

@@ -41,4 +41,4 @@ "main": "build/index.js",

"devDependencies": {
"@commitlint/cli": "^17.4.1",
"@commitlint/config-conventional": "^17.4.0",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@japa/assert": "^1.3.6",

@@ -49,3 +49,3 @@ "@japa/expect-type": "^1.0.2",

"@japa/spec-reporter": "^1.3.2",
"@swc/core": "^1.3.26",
"@swc/core": "^1.3.27",
"@types/node": "^18.11.18",

@@ -55,3 +55,3 @@ "c8": "^7.12.0",

"del-cli": "^5.0.0",
"eslint": "^8.31.0",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.6.0",

@@ -64,3 +64,3 @@ "eslint-plugin-adonis": "^3.0.3",

"pino-pretty": "^9.1.1",
"prettier": "^2.8.2",
"prettier": "^2.8.3",
"ts-node": "^10.9.1",

@@ -70,3 +70,3 @@ "typescript": "^4.9.4"

"dependencies": {
"@poppinss/utils": "^6.3.1-0",
"@poppinss/utils": "^6.4.0-0",
"@types/pino": "^7.0.5",

@@ -73,0 +73,0 @@ "abstract-logging": "^2.0.1",

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