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

pino-sentry

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-sentry - npm Package Compare versions

Comparing version 0.12.0 to 0.13.0

10

dist/transport.d.ts
/// <reference types="node" />
/// <reference types="node" />
import stream from 'stream';
import { AsyncResource } from 'async_hooks';
import * as Sentry from '@sentry/node';

@@ -60,3 +62,4 @@ declare type ValueOf<T> = T extends any[] ? T[number] : T[keyof T];

transformer(): stream.Transform;
prepareAndGo(chunk: any, cb: any): void;
prepareAndGo(chunkInfo: ChunkInfo, cb: any): void;
private chunkInfoCallback;
private validateOptions;

@@ -67,4 +70,9 @@ private isObject;

}
declare class ChunkInfo extends AsyncResource {
private readonly chunk;
constructor(chunk: any);
run<T extends readonly unknown[], R>(callback: (...args: any[]) => R, ...args: T): R;
}
export declare function createWriteStream(options?: PinoSentryOptions): stream.Duplex;
export declare const createWriteStreamAsync: typeof createWriteStream;
export {};

36

dist/transport.js

@@ -30,2 +30,3 @@ "use strict";

exports.createWriteStreamAsync = exports.createWriteStream = exports.PinoSentryTransport = exports.Severity = exports.SentryInstance = void 0;
const async_hooks_1 = require("async_hooks");
const split2_1 = __importDefault(require("split2"));

@@ -108,3 +109,8 @@ const pumpify_1 = __importDefault(require("pumpify"));

}
prepareAndGo(chunk, cb) {
prepareAndGo(chunkInfo, cb) {
chunkInfo.run((chunk) => {
this.chunkInfoCallback(chunk, cb);
});
}
chunkInfoCallback(chunk, cb) {
const severity = this.getLogSeverity(chunk.level);

@@ -150,13 +156,9 @@ // Check if we send this Severity to Sentry

const error = message instanceof Error ? message : new ExtendedError({ message, stack });
setImmediate(() => {
Sentry.captureException(error, scope);
cb();
});
Sentry.captureException(error, scope);
setImmediate(cb);
}
else {
// Capturing Messages
setImmediate(() => {
Sentry.captureMessage(message, scope);
cb();
});
Sentry.captureMessage(message, scope);
setImmediate(cb);
}

@@ -209,2 +211,16 @@ }

exports.PinoSentryTransport = PinoSentryTransport;
class ChunkInfo extends async_hooks_1.AsyncResource {
constructor(chunk) {
super("ChunkInfo");
this.chunk = chunk;
}
run(callback, ...args) {
try {
return this.runInAsyncScope(callback, undefined, this.chunk, ...args);
}
finally {
this.emitDestroy();
}
}
}
function createWriteStream(options) {

@@ -215,3 +231,3 @@ const transport = new PinoSentryTransport(options);

try {
return JSON.parse(line);
return new ChunkInfo(JSON.parse(line));
}

@@ -218,0 +234,0 @@ catch (e) {

@@ -60,3 +60,3 @@ {

},
"version": "0.12.0"
"version": "0.13.0"
}
# pino-sentry
[![CircleCI](https://circleci.com/gh/aandrewww/pino-sentry.svg?style=svg)](https://circleci.com/gh/aandrewww/pino-sentry)
[![node](https://img.shields.io/badge/node-10.0+-brightgreen.svg)][node-url]

@@ -5,0 +4,0 @@ [![license](https://img.shields.io/github/license/aandrewww/pino-sentry.svg)][license-url]

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