Skip to content

Commit 73919e6

Browse files
committed
fix log parameter types???
1 parent 91641f9 commit 73919e6

File tree

2 files changed

+365
-6
lines changed

2 files changed

+365
-6
lines changed

packages/node-core/src/logs/capture.ts

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { _INTERNAL_captureLog } from '@sentry/core';
55
/**
66
* Additional metadata to capture the log with.
77
*/
8-
interface CaptureLogMetadata {
8+
export interface CaptureLogMetadata {
99
scope?: Scope;
1010
}
1111

@@ -26,10 +26,25 @@ export type CaptureLogArgs = CaptureLogArgWithTemplate | CaptureLogArgWithoutTem
2626

2727
/**
2828
* Capture a log with the given level.
29-
*
30-
* @param level - The level of the log.
31-
* @param message - The message to log.
32-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.
29+
*/
30+
export function captureLog(
31+
level: LogSeverityLevel,
32+
message: ParameterizedString,
33+
attributes?: Log['attributes'],
34+
metadata?: CaptureLogMetadata,
35+
): void;
36+
/**
37+
* Capture a log with the given level.
38+
*/
39+
export function captureLog(
40+
level: LogSeverityLevel,
41+
messageTemplate: string,
42+
messageParams: Array<unknown>,
43+
attributes?: Log['attributes'],
44+
metadata?: CaptureLogMetadata,
45+
): void;
46+
/**
47+
* Capture a log with the given level.
3348
*/
3449
export function captureLog(level: LogSeverityLevel, ...args: CaptureLogArgs): void {
3550
const [messageOrMessageTemplate, paramsOrAttributes, maybeAttributesOrMetadata, maybeMetadata] = args;

0 commit comments

Comments
 (0)