You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/logger/index.ts
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ import {
8
8
9
9
/**
10
10
* `LogSeverity` indicates the detailed severity of the log entry. See [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).
11
+
* @public
11
12
*/
12
13
exporttypeLogSeverity=
13
14
|'DEBUG'
@@ -23,6 +24,7 @@ export type LogSeverity =
23
24
* `LogEntry` represents a [structured Cloud Logging](https://cloud.google.com/logging/docs/structured-logging)
24
25
* entry. All keys aside from `severity` and `message` are
25
26
* included in the `jsonPayload` of the logged entry.
27
+
* @public
26
28
*/
27
29
exportinterfaceLogEntry{
28
30
severity: LogSeverity;
@@ -62,7 +64,8 @@ function removeCircular(obj: any, refs: any[] = []): any {
62
64
63
65
/**
64
66
* Writes a `LogEntry` to `stdout`/`stderr` (depending on severity).
65
-
* @param entry The `LogEntry` including severity, message, and any additional structured metadata.
67
+
* @param entry - The `LogEntry` including severity, message, and any additional structured metadata.
68
+
* @public
66
69
*/
67
70
exportfunctionwrite(entry: LogEntry){
68
71
if(SUPPORTS_STRUCTURED_LOGS){
@@ -94,7 +97,8 @@ export function write(entry: LogEntry) {
94
97
/**
95
98
* Writes a `DEBUG` severity log. If the last argument provided is a plain object,
96
99
* it is added to the `jsonPayload` in the Cloud Logging entry.
97
-
* @param args Arguments, concatenated into the log message with space separators.
100
+
* @param args - Arguments, concatenated into the log message with space separators.
101
+
* @public
98
102
*/
99
103
exportfunctiondebug(...args: any[]){
100
104
write(entryFromArgs('DEBUG',args));
@@ -103,7 +107,8 @@ export function debug(...args: any[]) {
103
107
/**
104
108
* Writes an `INFO` severity log. If the last argument provided is a plain object,
105
109
* it is added to the `jsonPayload` in the Cloud Logging entry.
106
-
* @param args Arguments, concatenated into the log message with space separators.
110
+
* @param args - Arguments, concatenated into the log message with space separators.
111
+
* @public
107
112
*/
108
113
exportfunctionlog(...args: any[]){
109
114
write(entryFromArgs('INFO',args));
@@ -112,7 +117,8 @@ export function log(...args: any[]) {
112
117
/**
113
118
* Writes an `INFO` severity log. If the last argument provided is a plain object,
114
119
* it is added to the `jsonPayload` in the Cloud Logging entry.
115
-
* @param args Arguments, concatenated into the log message with space separators.
120
+
* @param args - Arguments, concatenated into the log message with space separators.
121
+
* @public
116
122
*/
117
123
exportfunctioninfo(...args: any[]){
118
124
write(entryFromArgs('INFO',args));
@@ -121,7 +127,8 @@ export function info(...args: any[]) {
121
127
/**
122
128
* Writes a `WARNING` severity log. If the last argument provided is a plain object,
123
129
* it is added to the `jsonPayload` in the Cloud Logging entry.
124
-
* @param args Arguments, concatenated into the log message with space separators.
130
+
* @param args - Arguments, concatenated into the log message with space separators.
131
+
* @public
125
132
*/
126
133
exportfunctionwarn(...args: any[]){
127
134
write(entryFromArgs('WARNING',args));
@@ -130,7 +137,8 @@ export function warn(...args: any[]) {
130
137
/**
131
138
* Writes an `ERROR` severity log. If the last argument provided is a plain object,
132
139
* it is added to the `jsonPayload` in the Cloud Logging entry.
133
-
* @param args Arguments, concatenated into the log message with space separators.
140
+
* @param args - Arguments, concatenated into the log message with space separators.
0 commit comments