UNPKG

2.41 kBTypeScriptView Raw
1/**
2 * `LogSeverity` indicates the detailed severity of the log entry. See [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).
3 * @public
4 */
5export type LogSeverity = "DEBUG" | "INFO" | "NOTICE" | "WARNING" | "ERROR" | "CRITICAL" | "ALERT" | "EMERGENCY";
6/**
7 * `LogEntry` represents a [structured Cloud Logging](https://cloud.google.com/logging/docs/structured-logging)
8 * entry. All keys aside from `severity` and `message` are
9 * included in the `jsonPayload` of the logged entry.
10 * @public
11 */
12export interface LogEntry {
13 severity: LogSeverity;
14 message?: string;
15 [key: string]: any;
16}
17/**
18 * Writes a `LogEntry` to `stdout`/`stderr` (depending on severity).
19 * @param entry - The `LogEntry` including severity, message, and any additional structured metadata.
20 * @public
21 */
22export declare function write(entry: LogEntry): void;
23/**
24 * Writes a `DEBUG` severity log. If the last argument provided is a plain object,
25 * it is added to the `jsonPayload` in the Cloud Logging entry.
26 * @param args - Arguments, concatenated into the log message with space separators.
27 * @public
28 */
29export declare function debug(...args: any[]): void;
30/**
31 * Writes an `INFO` severity log. If the last argument provided is a plain object,
32 * it is added to the `jsonPayload` in the Cloud Logging entry.
33 * @param args - Arguments, concatenated into the log message with space separators.
34 * @public
35 */
36export declare function log(...args: any[]): void;
37/**
38 * Writes an `INFO` severity log. If the last argument provided is a plain object,
39 * it is added to the `jsonPayload` in the Cloud Logging entry.
40 * @param args - Arguments, concatenated into the log message with space separators.
41 * @public
42 */
43export declare function info(...args: any[]): void;
44/**
45 * Writes a `WARNING` severity log. If the last argument provided is a plain object,
46 * it is added to the `jsonPayload` in the Cloud Logging entry.
47 * @param args - Arguments, concatenated into the log message with space separators.
48 * @public
49 */
50export declare function warn(...args: any[]): void;
51/**
52 * Writes an `ERROR` severity log. If the last argument provided is a plain object,
53 * it is added to the `jsonPayload` in the Cloud Logging entry.
54 * @param args - Arguments, concatenated into the log message with space separators.
55 * @public
56 */
57export declare function error(...args: any[]): void;