From a5ab131e49daaf41b86fab8e857df88aea0373d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 4 Nov 2024 12:10:01 +0100 Subject: [PATCH 1/3] log: Update package documentation --- log/DESIGN.md | 6 ++---- log/doc.go | 2 +- log/logger.go | 3 +++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/log/DESIGN.md b/log/DESIGN.md index 2d0c27b1e25..da1865191a1 100644 --- a/log/DESIGN.md +++ b/log/DESIGN.md @@ -26,14 +26,12 @@ This proposed design aims to: The API is published as a single `go.opentelemetry.io/otel/log` Go module. -The module name is compliant with -[Artifact Naming](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md#artifact-naming) -and the package structure is the same as for Trace API and Metrics API. - +The package structure is similar to Trace API and Metrics API. The Go module consists of the following packages: - `go.opentelemetry.io/otel/log` - `go.opentelemetry.io/otel/log/embedded` +- `go.opentelemetry.io/otel/log/logtest` - `go.opentelemetry.io/otel/log/noop` Rejected alternative: diff --git a/log/doc.go b/log/doc.go index e91476da800..18cbd1cb2e5 100644 --- a/log/doc.go +++ b/log/doc.go @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 /* -Package log provides the OpenTelemetry Logs Bridge API. +Package log provides the OpenTelemetry Logs API. This package is intended to be used by bridges between existing logging libraries and OpenTelemetry. Users should not directly use this package as a diff --git a/log/logger.go b/log/logger.go index 985d0494f4a..3799e46d3a6 100644 --- a/log/logger.go +++ b/log/logger.go @@ -28,6 +28,9 @@ type Logger interface { // // Implementations of this method need to be safe for a user to call // concurrently. + // + // Notice: Emit is intended to be used be log bridges. + // Is should not be used for writing instrumentation. Emit(ctx context.Context, record Record) // Enabled returns whether the Logger emits for the given context and From 53bf19e2e4ea521fd9e1f2f38398e6b91b73fec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 4 Nov 2024 12:11:41 +0100 Subject: [PATCH 2/3] fix comment --- log/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log/logger.go b/log/logger.go index 3799e46d3a6..99692f6a7dd 100644 --- a/log/logger.go +++ b/log/logger.go @@ -29,7 +29,7 @@ type Logger interface { // Implementations of this method need to be safe for a user to call // concurrently. // - // Notice: Emit is intended to be used be log bridges. + // Notice: Emit is intended to be used by log bridges. // Is should not be used for writing instrumentation. Emit(ctx context.Context, record Record) From 8eb4909229c159f87ade1647095883cb8ad53294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Mon, 4 Nov 2024 12:12:13 +0100 Subject: [PATCH 3/3] Document Enabled --- log/logger.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/log/logger.go b/log/logger.go index 99692f6a7dd..fe826819d8b 100644 --- a/log/logger.go +++ b/log/logger.go @@ -53,6 +53,9 @@ type Logger interface { // // Implementations of this method need to be safe for a user to call // concurrently. + // + // Notice: Enabled is intended to be used by log bridges. + // Is should not be used for writing instrumentation. Enabled(ctx context.Context, param EnabledParameters) bool }