@makeflow/gateway
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -31,2 +31,3 @@ /// <reference types="node" /> | ||
export interface LogEventData { | ||
level: 'info' | 'warn' | 'error'; | ||
/** The event that triggers this log. */ | ||
@@ -33,0 +34,0 @@ event: string; |
@@ -19,4 +19,5 @@ "use strict"; | ||
this.targets = []; | ||
this.log = (event, data) => { | ||
this.log = (level, event, data) => { | ||
this.emit('log', { | ||
level, | ||
event, | ||
@@ -23,0 +24,0 @@ ...data, |
@@ -1,1 +0,2 @@ | ||
export declare type LogFunction = (event: string, data: object) => void; | ||
export declare type LogLevel = 'info' | 'warn' | 'error'; | ||
export declare type LogFunction = (level: LogLevel, event: string, data: object) => void; |
@@ -14,3 +14,3 @@ "use strict"; | ||
this.proxy = http_proxy_1.createProxyServer({ ...options, ignorePath: true }); | ||
this.proxy.on('error', error => this.log('proxy-server-error', { error })); | ||
this.proxy.on('error', error => this.log('error', 'proxy-server-error', { error })); | ||
} | ||
@@ -17,0 +17,0 @@ async handle(context, _next, base) { |
{ | ||
"name": "@makeflow/gateway", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -86,4 +86,5 @@ import assert from 'assert'; | ||
protected log: LogFunction = (event, data) => { | ||
protected log: LogFunction = (level, event, data) => { | ||
this.emit('log', { | ||
level, | ||
event, | ||
@@ -140,2 +141,3 @@ ...data, | ||
export interface LogEventData { | ||
level: 'info' | 'warn' | 'error'; | ||
/** The event that triggers this log. */ | ||
@@ -142,0 +144,0 @@ event: string; |
@@ -1,1 +0,7 @@ | ||
export type LogFunction = (event: string, data: object) => void; | ||
export type LogLevel = 'info' | 'warn' | 'error'; | ||
export type LogFunction = ( | ||
level: LogLevel, | ||
event: string, | ||
data: object, | ||
) => void; |
@@ -30,3 +30,5 @@ import {IncomingMessage, OutgoingMessage, Server as HTTPServer} from 'http'; | ||
this.proxy.on('error', error => this.log('proxy-server-error', {error})); | ||
this.proxy.on('error', error => | ||
this.log('error', 'proxy-server-error', {error}), | ||
); | ||
} | ||
@@ -33,0 +35,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
51254
1031