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
{{ message }}
Repository navigation
Commit e8da4f0
Browse filesBrowse the repository at this point in the historyBrowse files
fix(logging-utils): export LogSeverity as value and treat 'true' as '*' alias (#9718)
Exports `LogSeverity` as a runtime value and treats `"true"` as `"*"`
### Changes:
- Export `LogSeverity` as a value instead of `export type` in
`src/index.ts`
- Normalize `nodeFlag === 'true'` to `'*'` in `DebugLogBackendBase`
- Added unit tests for runtime `LogSeverity` exports and `"true"` filter
normalization.
Copy file name to clipboardExpand all lines: core/packages/logging-utils/README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,8 @@ This package defines an ad-hoc debug logger utility that can be used as a lightw
6
6
## Contracts
7
7
These are logging utilities meant primarily for use as an "adhoc debug logger" inside Google libraries. It's possible to use this outside of that context, but it is currently not supported. (You're on your own.)
8
8
9
-
Additionally, everything about the debug logging is not intended to be a stable interface - you can't rely on messages to remain the same, or to continue to exist from one version to the next. For now, it is meant to be a tool for local usage by users, to get the equivalent of "printf debugging" output. In the future, it may tie into more things (OpenTelemetry Logging, etc). Structured log output is possible for vacuuming into Cloud Logging.
10
-
11
-
This npm package itself is intended to follow semver standards for its own interfaces, but no guarantees are made for supported time windows, etc.
9
+
***Stable Package API (SemVer 1.x):** The exported programmatic interface—`log()`, `placeholder`, `LogFields`, `LogSeverity`, `AdhocDebugLogFunction` (including `.on('log', ...)` and `.sublog()`), `setBackend()`, `getNodeBackend()`, `getStructuredBackend()`, and `env.nodeEnables` (`GOOGLE_SDK_NODE_LOGGING`)—is a strict SemVer-stable contract used across `google-gax`, `google-auth-library`, `gcp-metadata`, and `@google-cloud/*`.
10
+
***Non-Contractual Log Output:** Exact human-readable log message strings and the addition of new diagnostic attributes in `LogFields.other` may evolve across minor versions so customers do not rely on regex-parsing prose messages. For now, it is meant to be a tool for local usage by users, to get the equivalent of "printf debugging" output. In the future, it may tie into more things (OpenTelemetry Logging, etc). Structured log output is possible for vacuuming into Cloud Logging.
12
11
13
12
## Usage
14
13
The user interface for this logging is very similar to Node's built-in logging. The primary unit of logging is called a "system", and some libraries may have sub-units called "subsystems". You separate the system and subsystem with a colon, like "pubsub:leasing" or similar. Wildcards may be used (e.g. "pubsub:*"), and multiple of these system/system:subsystem pairs may be listed out, separated by commas. For generated GAPIC libraries, the "system" will generally be the part of the package name specific to the library (e.g. `@google-cloud/translate` will be `translate`).
0 commit comments