Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@ythub/logger

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

@ythub/logger - npm Package Compare versions

Comparing version
1.1.0
to
1.1.1
+2
-1
package.json
{
"name": "@ythub/logger",
"version": "1.1.0",
"version": "1.1.1",
"main": "dist/index.js",

@@ -16,2 +16,3 @@ "typings": "dist/index.d.ts",

"dependencies": {
"@mechanicalhuman/bunyan-pretty": "^3.0.1",
"bunyan": "^1.8.15",

@@ -18,0 +19,0 @@ "tslib": "^2.3.0",

@@ -1,12 +0,23 @@

import * as bunyan from 'bunyan'
import pretty from '@mechanicalhuman/bunyan-pretty'
import Logger, * as bunyan from 'bunyan'
import { LogLevel } from 'bunyan'
import { BunyanStackdriverAdapter } from './BunyanStackdriverAdapter'
export { bunyan as Logger }
export function createLogger(name: string = 'logger'): bunyan {
const prettyStream = pretty(process.stdout, { timeStamps: false, depth: 2 })
export function createLogger(name: string = 'logger', level: LogLevel = 'info'): Logger {
const isProduction = process.env.NODE_ENV === 'production'
return bunyan.createLogger({
name,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
streams: [{ type: 'raw', stream: new BunyanStackdriverAdapter() as any }],
level,
...(isProduction
? {
streams: [{ type: 'raw', stream: new BunyanStackdriverAdapter() as unknown }],
}
: {
stream: prettyStream,
}),
})
}

@@ -0,2 +1,5 @@

import Logger from 'bunyan'
export * from './createLogger'
export * from './BunyanStackdriverAdapter'
export { Logger }