grpc-code-gen
Advanced tools
Comparing version 3.6.1 to 3.6.2
@@ -395,2 +395,3 @@ "use strict"; | ||
const origin = Service.prototype[key]; | ||
const methodId = origin.path.replace(/\\//g, '.').replace(/^\\./, ''); | ||
Service.prototype[key] = promisify(function(this: any, request: any, options: any, callback: any) { | ||
@@ -412,5 +413,5 @@ if (typeof callback !== 'undefined') { | ||
const duration = (Date.now() - start) / 1000; | ||
console.info('grpc invoke:', key, 'duration:', duration + 's', 'request:', request); | ||
console.info('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request); | ||
if (err) { | ||
console.error('grpc invoke:', key, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
console.error('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
} | ||
@@ -442,2 +443,3 @@ } | ||
const origin = ${service.name}.prototype[key]; | ||
const methodId = origin.path.replace(/\\//g, '.').replace(/^\\./, ''); | ||
${service.name}.prototype[key] = promisify(function(request, options, callback) { | ||
@@ -458,5 +460,5 @@ if (typeof callback !== 'undefined') { | ||
const duration = (Date.now() - start) / 1000; | ||
console.info('grpc invoke:', key, 'duration:', duration + 's', 'request:', request); | ||
console.info('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request); | ||
if (err) { | ||
console.error('grpc invoke:', key, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
console.error('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
} | ||
@@ -463,0 +465,0 @@ } |
{ | ||
"name": "grpc-code-gen", | ||
"version": "3.6.1", | ||
"version": "3.6.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/yunkeCN/grpc-code-gen.git", |
@@ -474,2 +474,3 @@ import * as fs from 'fs-extra'; | ||
const origin = Service.prototype[key]; | ||
const methodId = origin.path.replace(/\\//g, '.').replace(/^\\./, ''); | ||
Service.prototype[key] = promisify(function(this: any, request: any, options: any, callback: any) { | ||
@@ -491,5 +492,5 @@ if (typeof callback !== 'undefined') { | ||
const duration = (Date.now() - start) / 1000; | ||
console.info('grpc invoke:', key, 'duration:', duration + 's', 'request:', request); | ||
console.info('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request); | ||
if (err) { | ||
console.error('grpc invoke:', key, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
console.error('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
} | ||
@@ -520,2 +521,3 @@ } | ||
const origin = ${service.name}.prototype[key]; | ||
const methodId = origin.path.replace(/\\//g, '.').replace(/^\\./, ''); | ||
${service.name}.prototype[key] = promisify(function(request, options, callback) { | ||
@@ -536,5 +538,5 @@ if (typeof callback !== 'undefined') { | ||
const duration = (Date.now() - start) / 1000; | ||
console.info('grpc invoke:', key, 'duration:', duration + 's', 'request:', request); | ||
console.info('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request); | ||
if (err) { | ||
console.error('grpc invoke:', key, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
console.error('grpc invoke:', methodId, 'duration:', duration + 's', 'request:', request, 'err:', err); | ||
} | ||
@@ -541,0 +543,0 @@ } |
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
127339
1886