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

akos-logger-promotion

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

akos-logger-promotion - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

11

lib/requestLogger.js

@@ -13,9 +13,6 @@

let fields = null;
const cookie = ctx.get('Cookie');
const start = moment();
const requestId = ctx.requestId || uuid.v4();
const requestId = ctx.app.requestId || uuid.v4();
const log = ctx.logger || console.log;
let msg = `enter:${ctx.ip}requestId_${requestId}-${chalk.magenta(ctx.method)} "${ctx.path}" from ${ctx.ip}`;
if (cookie && options.cookie)
msg += ` with cookie "${cookie}"`;

@@ -52,7 +49,7 @@ if (ctx.query && !_.isEmpty(ctx.query))

if (ctx.errors && ctx.errors.length)
log.warn(`[akos-logger-promotion] %s`, `Request validation errros: ${ctx.errors}`);
log.warn('[akos-logger-promotion] %s', `Request validation errros: ${ctx.errors}`);
if (ctx.type === 'application/json')
log.info(`[akos-logger-promotion] %s`, `leave: ${ctx.ip} requestId_ ${requestId}-${ctx.method} ${ctx.path} complete ${chalk.bold.white.bgMagenta(ctx.status)} at ${chalk.bold.cyan(moment() - start)}ms with body ${body}`);
log.info('[akos-logger-promotion] %s', `leave: ${ctx.ip} requestId_ ${requestId}-${ctx.method} ${ctx.path} complete ${chalk.bold.white.bgMagenta(ctx.status)} at ${chalk.bold.cyan(moment() - start)}ms with body ${body}`);
else
log.info(`[akos-logger-promotion] %s`, `leave res: ${ctx.ip} requestId_${requestId}-${ctx.method} ${ctx.path} complete ${chalk.bold.white.bgMagenta(ctx.status)} at ${chalk.bold.cyan(moment() - start)}ms`);
log.info('[akos-logger-promotion] %s', `leave res: ${ctx.ip} requestId_${requestId}-${ctx.method} ${ctx.path} complete ${chalk.bold.white.bgMagenta(ctx.status)} at ${chalk.bold.cyan(moment() - start)}ms`);
};
{
"name": "akos-logger-promotion",
"description": "a logger promotion for akos",
"version": "0.0.3",
"version": "0.0.4",
"main": "main.js",

@@ -6,0 +6,0 @@ "directories": {

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