backtrace-service
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -56,3 +56,8 @@ export interface IConfig { | ||
} | ||
export interface IServiceConfiguration { | ||
name: string; | ||
endpoint: string; | ||
} | ||
export interface IServerConfiguration { | ||
token: string; | ||
config: IConfig; | ||
@@ -65,2 +70,3 @@ endpoints: IEndpoints; | ||
user: IUser; | ||
services: IServiceConfiguration[]; | ||
ephemeral: IEphemeral; | ||
@@ -67,0 +73,0 @@ universe: IUniverse; |
/** | ||
* Identity | ||
*/ | ||
export { IServerConfiguration } from './identity/model/serverConfiguration'; | ||
export { IUser, IServerConfiguration, IUniverse, IUniverseProject, IProjectsExt, } from './identity/model/serverConfiguration'; | ||
export { IdentityManager } from './identity/identity'; | ||
@@ -24,3 +24,3 @@ export { ICoronerRequestOption } from './identity/model/authRequestOptions'; | ||
export { IServiceDescriptor } from './model/serviceDescriptor'; | ||
export { getDescriptor, listenDescriptor, } from './config/config'; | ||
export { getDescriptor, listenDescriptor } from './config/config'; | ||
export { ICoronerDescriptor } from './config/model/coronerDescriptor'; | ||
@@ -27,0 +27,0 @@ export { IDescriptorOpts } from './config/model/descriptorOptions'; |
import { BacktraceClientOptions, IBacktraceClientOptions } from 'backtrace-node'; | ||
export declare class Logger { | ||
private logLevel; | ||
static getLogger(): Logger; | ||
@@ -4,0 +5,0 @@ static initializeBacktrace(opts: BacktraceClientOptions | IBacktraceClientOptions): void; |
@@ -15,2 +15,3 @@ "use strict"; | ||
if (logLevel === void 0) { logLevel = 'debug'; } | ||
this.logLevel = logLevel; | ||
// transportLevel definition that Logger class respect: | ||
@@ -79,3 +80,3 @@ // #define SD_EMERG "<0>" /* system is unusable */ | ||
// tslint:disable-next-line:max-line-length | ||
return "<" + this.transportLevelNumber + ">" + this.transportLevel + ":[" + new Date().toLocaleString() + "] " + msg; | ||
return "<" + this.transportLevelNumber + ">" + this.logLevel + ":[" + new Date().toLocaleString() + "] " + msg; | ||
}; | ||
@@ -82,0 +83,0 @@ return Logger; |
@@ -6,2 +6,3 @@ import { Logger } from './../log/logger'; | ||
logger?: Logger; | ||
coronerdCallback?: (ip: string) => void; | ||
} |
@@ -34,3 +34,3 @@ "use strict"; | ||
} | ||
this.metrics = new metricsStorage_1.MetricsStorage(this.configuration.metrics.secret, this.configuration.metrics.uuid, undefined, this.app); | ||
this.metrics = new metricsStorage_1.MetricsStorage(this.configuration.metrics && this.configuration.metrics.uuid, this.configuration.metrics && this.configuration.metrics.secret, undefined, this.app); | ||
this.prepareServiceLayer(); | ||
@@ -60,2 +60,5 @@ BacktraceService._service = this; | ||
service.coronerdAddress.add(ip); | ||
if (opts && opts.coronerdCallback) { | ||
opts.coronerdCallback(ip); | ||
} | ||
}); | ||
@@ -128,8 +131,3 @@ if (!name.startsWith('backtrace')) { | ||
secret: serviceDescriptor.secret, | ||
coronerdCallback: function (address) { | ||
if (coronerdCallback) { | ||
coronerdCallback(address); | ||
} | ||
logger.info("Coronerd address: " + address); | ||
}, | ||
coronerdCallback: coronerdCallback, | ||
})); | ||
@@ -136,0 +134,0 @@ }; |
{ | ||
"name": "backtrace-service", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Common tools for Backtrace Node services", | ||
@@ -5,0 +5,0 @@ "author": "Backtrace", |
@@ -65,4 +65,9 @@ export interface IConfig { | ||
} | ||
export interface IServiceConfiguration { | ||
name: string; | ||
endpoint: string; | ||
} | ||
export interface IServerConfiguration { | ||
token: string; | ||
config: IConfig; | ||
@@ -75,2 +80,3 @@ endpoints: IEndpoints; | ||
user: IUser; | ||
services: IServiceConfiguration[]; | ||
ephemeral: IEphemeral; | ||
@@ -77,0 +83,0 @@ universe: IUniverse; |
/** | ||
* Identity | ||
*/ | ||
export { IServerConfiguration } from './identity/model/serverConfiguration'; | ||
export { | ||
IUser, | ||
IServerConfiguration, | ||
IUniverse, | ||
IUniverseProject, | ||
IProjectsExt, | ||
} from './identity/model/serverConfiguration'; | ||
export { IdentityManager } from './identity/identity'; | ||
@@ -27,6 +33,3 @@ export { ICoronerRequestOption } from './identity/model/authRequestOptions'; | ||
export { IServiceDescriptor } from './model/serviceDescriptor'; | ||
export { | ||
getDescriptor, | ||
listenDescriptor, | ||
} from './config/config'; | ||
export { getDescriptor, listenDescriptor } from './config/config'; | ||
export { ICoronerDescriptor } from './config/model/coronerDescriptor'; | ||
@@ -33,0 +36,0 @@ export { IDescriptorOpts } from './config/model/descriptorOptions'; |
@@ -50,3 +50,3 @@ import { | ||
private transportLevelNumber!: number; | ||
constructor(logLevel: string = 'debug') { | ||
constructor(private logLevel: string = 'debug') { | ||
this.transportLevelNumber = | ||
@@ -87,6 +87,4 @@ this.transportLevel[logLevel] || this.transportLevel['debug']; | ||
// tslint:disable-next-line:max-line-length | ||
return `<${this.transportLevelNumber}>${ | ||
this.transportLevel | ||
}:[${new Date().toLocaleString()}] ${msg}`; | ||
return `<${this.transportLevelNumber}>${this.logLevel}:[${new Date().toLocaleString()}] ${msg}`; | ||
} | ||
} |
@@ -7,2 +7,3 @@ import { Logger } from './../log/logger'; | ||
logger?: Logger; | ||
coronerdCallback?: (ip: string) => void; | ||
} |
@@ -46,2 +46,5 @@ import { json, urlencoded } from 'body-parser'; | ||
service.coronerdAddress.add(ip); | ||
if (opts && opts.coronerdCallback) { | ||
opts.coronerdCallback(ip); | ||
} | ||
}); | ||
@@ -137,8 +140,3 @@ if (!name.startsWith('backtrace')) { | ||
secret: serviceDescriptor.secret, | ||
coronerdCallback: (address: string) => { | ||
if (coronerdCallback) { | ||
coronerdCallback(address); | ||
} | ||
logger.info(`Coronerd address: ${address}`); | ||
}, | ||
coronerdCallback, | ||
} as ICoronerRequestOption), | ||
@@ -188,5 +186,6 @@ ); | ||
} | ||
this.metrics = new MetricsStorage( | ||
this.configuration.metrics.secret, | ||
this.configuration.metrics.uuid, | ||
this.configuration.metrics && this.configuration.metrics.uuid, | ||
this.configuration.metrics && this.configuration.metrics.secret, | ||
undefined, | ||
@@ -193,0 +192,0 @@ this.app, |
Sorry, the diff of this file is not supported yet
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
160341
2824