File tree Expand file tree Collapse file tree 4 files changed +33
-18
lines changed
plugins/node/opentelemetry-instrumentation-winston Expand file tree Collapse file tree 4 files changed +33
-18
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,13 @@ import {
2929 isWrapped ,
3030 safeExecuteInTheMiddle ,
3131} from '@opentelemetry/instrumentation' ;
32- import {
33- WinstonInstrumentationConfig ,
32+ import type { WinstonInstrumentationConfig } from './types' ;
33+ import type {
3434 Winston2LogMethod ,
3535 Winston2LoggerModule ,
3636 Winston3LogMethod ,
3737 Winston3Logger ,
38- } from './types' ;
38+ } from './internal- types' ;
3939import { VERSION } from './version' ;
4040
4141const winston3Versions = [ '>=3 <4' ] ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright The OpenTelemetry Authors
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ import type { Logger as Winston3Logger } from 'winston' ;
18+ import type {
19+ LoggerInstance as Winston2Logger ,
20+ LogMethod as Winston2LogMethod ,
21+ } from 'winston2' ;
22+ export type Winston3LogMethod = Winston3Logger [ 'write' ] ;
23+ export type { Winston3Logger } ;
24+
25+ export type { Winston2LogMethod } ;
26+ export type Winston2LoggerModule = {
27+ Logger : Winston2Logger & { prototype : { log : Winston2LogMethod } } ;
28+ } ;
29+ export type { Winston2Logger } ;
Original file line number Diff line number Diff line change 1616
1717import { Span } from '@opentelemetry/api' ;
1818import { InstrumentationConfig } from '@opentelemetry/instrumentation' ;
19- import type { Logger as Winston3Logger } from 'winston' ;
20- import type {
21- LoggerInstance as Winston2Logger ,
22- LogMethod as Winston2LogMethod ,
23- } from 'winston2' ;
2419
2520// eslint-disable-next-line @typescript-eslint/no-explicit-any
2621export type LogHookFunction = ( span : Span , record : Record < string , any > ) => void ;
2722
2823export interface WinstonInstrumentationConfig extends InstrumentationConfig {
2924 logHook ?: LogHookFunction ;
3025}
31-
32- export type Winston3LogMethod = Winston3Logger [ 'write' ] ;
33- export type { Winston3Logger } ;
34-
35- export type { Winston2LogMethod } ;
36- export type Winston2LoggerModule = {
37- Logger : Winston2Logger & { prototype : { log : Winston2LogMethod } } ;
38- } ;
39- export type { Winston2Logger } ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks';
2525import * as assert from 'assert' ;
2626import * as sinon from 'sinon' ;
2727import { Writable } from 'stream' ;
28- import type { Winston2Logger , Winston3Logger } from '../src/types' ;
28+ import type { Winston2Logger , Winston3Logger } from '../src/internal- types' ;
2929import { WinstonInstrumentation } from '../src' ;
3030
3131const memoryExporter = new InMemorySpanExporter ( ) ;
You can’t perform that action at this time.
0 commit comments