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

@bogeychan/elysia-logger

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bogeychan/elysia-logger - npm Package Compare versions

Comparing version 0.0.20 to 0.0.21

16

dist/index.js

@@ -30,2 +30,11 @@ import pino from "pino";

let log;
const getLog = (ctx) => {
if (!log) {
log =
typeof options.customProps === "function"
? this.child(options.customProps(ctx))
: this;
}
return log;
};
let app = new Elysia({

@@ -35,7 +44,3 @@ name: "@bogeychan/elysia-logger",

}).derive({ as: "global" }, (ctx) => {
log =
typeof options.customProps === "function"
? this.child(options.customProps(ctx))
: this;
return { log };
return { log: getLog(ctx) };
});

@@ -48,2 +53,3 @@ if (autoLogging) {

.onResponse({ as: "global" }, (ctx) => {
const log = getLog(ctx);
if (log.level == "silent") {

@@ -50,0 +56,0 @@ return;

{
"name": "@bogeychan/elysia-logger",
"version": "0.0.20",
"version": "0.0.21",
"description": "A plugin for Elysia.js for logging using the pino library",

@@ -5,0 +5,0 @@ "author": {

@@ -33,3 +33,3 @@ # @bogeychan/elysia-logger

console.log(`Listening on http://${app.server!.hostname}:${app.server!.port}`);
console.log(`Listening on ${app.server!.url}`);
```

@@ -36,0 +36,0 @@

import pino from "pino";
import { Elysia } from "elysia";
import { Context, Elysia } from "elysia";

@@ -91,2 +91,12 @@ import type {

const getLog = (ctx: Context) => {
if (!log) {
log =
typeof options.customProps === "function"
? this.child(options.customProps(ctx))
: this;
}
return log;
};
let app = new Elysia({

@@ -96,8 +106,3 @@ name: "@bogeychan/elysia-logger",

}).derive({ as: "global" }, (ctx) => {
log =
typeof options.customProps === "function"
? this.child(options.customProps(ctx))
: this;
return { log };
return { log: getLog(ctx) };
});

@@ -115,2 +120,4 @@

.onResponse({ as: "global" }, (ctx) => {
const log = getLog(ctx);
if (log.level == "silent") {

@@ -117,0 +124,0 @@ return;

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