From bfb95f57de3f9e0fc5d2d0d21dbd2cdb64fda903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 27 Dec 2023 14:07:02 +0100 Subject: [PATCH] Logger GoDoc --- log/logger.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/log/logger.go b/log/logger.go index d929a5e66f4..e496796733d 100644 --- a/log/logger.go +++ b/log/logger.go @@ -9,7 +9,7 @@ import ( "go.opentelemetry.io/otel/log/embedded" ) -// Logger TODO: comment. +// Logger emits log records. // // Warning: Methods may be added to this interface in minor releases. See // package documentation on API implementation for information on how to set @@ -17,11 +17,12 @@ import ( type Logger interface { embedded.Logger - // Emit TODO: comment. + // Emit emits a log record. // - // This method should not modify the record's attributes. - // - // This method should be safe to call concurrently. - // It should copy the record's attributes if the record is processed asynchronously. + // The implementation should: + // - be safe to call concurrently, + // - handle the trace context passed via ctx argument, + // - not modify the record's attributes, + // - copy the record's attributes in case of asynchronous processing. Emit(ctx context.Context, record Record) }