logger namespace

Functions

FunctionDescription
debug(args)Writes a DEBUG severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
error(args)Writes an ERROR severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
info(args)Writes an INFO severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
log(args)Writes an INFO severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
warn(args)Writes a WARNING severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.
write(entry)Writes a LogEntry to stdout/stderr (depending on severity).

Interfaces

InterfaceDescription
LogEntryLogEntry represents a [structured Cloud Logging](https://cloud.google.com/logging/docs/structured-logging) entry. All keys aside from severity and message are included in the jsonPayload of the logged entry.

Type Aliases

Type AliasDescription
LogSeverityLogSeverity indicates the detailed severity of the log entry. See [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).

logger.debug()

Writes a DEBUG severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.

Signature:

exportdeclarefunctiondebug(...args:any[]):void;

Parameters

ParameterTypeDescription
argsany[]Arguments, concatenated into the log message with space separators.

Returns:

void

logger.error()

Writes an ERROR severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.

Signature:

exportdeclarefunctionerror(...args:any[]):void;

Parameters

ParameterTypeDescription
argsany[]Arguments, concatenated into the log message with space separators.

Returns:

void

logger.info()

Writes an INFO severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.

Signature:

exportdeclarefunctioninfo(...args:any[]):void;

Parameters

ParameterTypeDescription
argsany[]Arguments, concatenated into the log message with space separators.

Returns:

void

logger.log()

Writes an INFO severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.

Signature:

exportdeclarefunctionlog(...args:any[]):void;

Parameters

ParameterTypeDescription
argsany[]Arguments, concatenated into the log message with space separators.

Returns:

void

logger.warn()

Writes a WARNING severity log. If the last argument provided is a plain object, it is added to the jsonPayload in the Cloud Logging entry.

Signature:

exportdeclarefunctionwarn(...args:any[]):void;

Parameters

ParameterTypeDescription
argsany[]Arguments, concatenated into the log message with space separators.

Returns:

void

logger.write()

Writes a LogEntry to stdout/stderr (depending on severity).

Signature:

exportdeclarefunctionwrite(entry:LogEntry):void;

Parameters

ParameterTypeDescription
entryLogEntryThe LogEntry including severity, message, and any additional structured metadata.

Returns:

void

logger.LogSeverity

LogSeverity indicates the detailed severity of the log entry. See [LogSeverity](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logseverity).

Signature:

exporttypeLogSeverity="DEBUG"|"INFO"|"NOTICE"|"WARNING"|"ERROR"|"CRITICAL"|"ALERT"|"EMERGENCY";