add typings for custom logger support (#27102)

This commit is contained in:
Jared Meek 2018-07-12 08:44:37 +01:00 committed by Ryan Cavanaugh
parent 5fe390b1fa
commit 4f0cd5c74a
2 changed files with 15 additions and 1 deletions

View File

@ -5,6 +5,10 @@ const tracer = ddTrace.init({
service: 'MyLovelyService',
hostname: 'localhost',
port: 8126,
logger: {
debug: msg => { },
error: err => { }
}
});
tracer

View File

@ -91,6 +91,16 @@ interface TracerOptions {
* @default true
*/
plugins?: boolean;
/**
* Custom logger to be used by the tracer (if debug = true),
* should support debug() and error() methods
* see https://datadog.github.io/dd-trace-js/#custom-logging__anchor
*/
logger?: {
debug: (message: string) => void
error: (err: Error) => void
};
}
interface ExperimentalOptions {
@ -135,5 +145,5 @@ interface TraceOptions {
/**
* Global tags that should be assigned to every span.
*/
tags?: { [key: string]: any; } | string;
tags?: { [key: string]: any } | string;
}