mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
add typings for custom logger support (#27102)
This commit is contained in:
parent
5fe390b1fa
commit
4f0cd5c74a
@ -5,6 +5,10 @@ const tracer = ddTrace.init({
|
||||
service: 'MyLovelyService',
|
||||
hostname: 'localhost',
|
||||
port: 8126,
|
||||
logger: {
|
||||
debug: msg => { },
|
||||
error: err => { }
|
||||
}
|
||||
});
|
||||
|
||||
tracer
|
||||
|
||||
12
types/dd-trace/index.d.ts
vendored
12
types/dd-trace/index.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user