From 00a7f2385382d5988ba0a319047b4c92047c3272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:35:05 +0100 Subject: [PATCH 01/17] Update sdk.md --- specification/logs/sdk.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index c61b81d560f..6a58a8b3b7e 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -16,6 +16,7 @@ * [ForceFlush](#forceflush) - [Logger](#logger) * [LoggerConfig](#loggerconfig) + * [Enabled](#enabled) - [Additional LogRecord interfaces](#additional-logrecord-interfaces) * [ReadableLogRecord](#readablelogrecord) * [ReadWriteLogRecord](#readwritelogrecord) @@ -191,6 +192,16 @@ It consists of the following parameters: necessary for implementations to ensure that changes to `disabled` are immediately visible to callers of `Enabled`. +### Enabled + +**Status**: [Development](../document-status.md) + +`Enabled` returns `false` when: + +- `Logger` is disabled (`LoggerConfig.disabled` is `true`). + +Otherwise, it returns `true`. + ## Additional LogRecord interfaces In this document we refer to `ReadableLogRecord` and `ReadWriteLogRecord`, defined as follows. From c3a13d135cd0a2693b14710b48ce8d48abad5d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:36:25 +0100 Subject: [PATCH 02/17] Update noop.md --- specification/logs/noop.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/specification/logs/noop.md b/specification/logs/noop.md index 6a1d8502106..2497a331c1b 100644 --- a/specification/logs/noop.md +++ b/specification/logs/noop.md @@ -15,6 +15,7 @@ linkTitle: No-Op * [Logger Creation](#logger-creation) - [Logger](#logger) * [Emit LogRecord](#emit-logrecord) + * [Enabled](#enabled) @@ -55,3 +56,7 @@ return the same `Logger` instances to all creation requests. The No-Op `Logger` MUST allow for [emitting LogRecords](./api.md#emit-a-logrecord). + +### Enabled + +Always returns `false`. From 22116b47bcb085bdf5b512d3105d4b8ed04044f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:37:06 +0100 Subject: [PATCH 03/17] Update noop.md --- specification/logs/noop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/logs/noop.md b/specification/logs/noop.md index 2497a331c1b..9dcbffa5ba0 100644 --- a/specification/logs/noop.md +++ b/specification/logs/noop.md @@ -59,4 +59,4 @@ for [emitting LogRecords](./api.md#emit-a-logrecord). ### Enabled -Always returns `false`. +MUST always returns `false`. From 669722b1214a9b1639bc6975acf85c3b0d5f0625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:39:09 +0100 Subject: [PATCH 04/17] Update sdk.md --- specification/logs/sdk.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 6a58a8b3b7e..7174210b601 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -196,11 +196,11 @@ It consists of the following parameters: **Status**: [Development](../document-status.md) -`Enabled` returns `false` when: +`Enabled` MUST return `false` when: - `Logger` is disabled (`LoggerConfig.disabled` is `true`). -Otherwise, it returns `true`. +Otherwise, it MUST return `true`. ## Additional LogRecord interfaces From 54439335c489ca6170098274c77bc98aa844987a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:43:21 +0100 Subject: [PATCH 05/17] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dfa39488f8..5118cadb53d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ release. ### Logs +- Define how SDK implements `Logger.Enabled`. + ([#4381](https://github.com/open-telemetry/opentelemetry-specification/pull/4381)) + ### Baggage ### Resource From 12d3d5369582ca3d6a139ffc7d8e2654bfb68696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:48:18 +0100 Subject: [PATCH 06/17] Update noop.md --- specification/logs/noop.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/logs/noop.md b/specification/logs/noop.md index 9dcbffa5ba0..d74ddfcb2ce 100644 --- a/specification/logs/noop.md +++ b/specification/logs/noop.md @@ -59,4 +59,6 @@ for [emitting LogRecords](./api.md#emit-a-logrecord). ### Enabled +**Status**: [Development](../document-status.md) + MUST always returns `false`. From 5d9fb39ce2d506f0ccfce2c18e425a168462fd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:48:37 +0100 Subject: [PATCH 07/17] Update noop.md --- specification/logs/noop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/logs/noop.md b/specification/logs/noop.md index d74ddfcb2ce..6ffb02ee034 100644 --- a/specification/logs/noop.md +++ b/specification/logs/noop.md @@ -4,7 +4,7 @@ linkTitle: No-Op # Logs API No-Op Implementation -**Status**: [Stable](../document-status.md) +**Status**: [Stable](../document-status.md), except where otherwise specified
Table of Contents From add112045a318bdb365ae9b26b6454a796ac32a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:55:32 +0100 Subject: [PATCH 08/17] Update sdk.md --- specification/logs/sdk.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 7174210b601..54e7f6088c9 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -200,7 +200,9 @@ It consists of the following parameters: - `Logger` is disabled (`LoggerConfig.disabled` is `true`). -Otherwise, it MUST return `true`. +Otherwise, it SHOULD return `true`. +_It is not a MUST, to allow the SDKs to have additional experimental features +which causes `Enabled` to return `false`._ ## Additional LogRecord interfaces From 544f9365621a618d1f44c4db4ab6d907af951ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 16:57:00 +0100 Subject: [PATCH 09/17] Update sdk.md --- specification/logs/sdk.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 54e7f6088c9..600ef8a2b95 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -200,9 +200,10 @@ It consists of the following parameters: - `Logger` is disabled (`LoggerConfig.disabled` is `true`). -Otherwise, it SHOULD return `true`. -_It is not a MUST, to allow the SDKs to have additional experimental features -which causes `Enabled` to return `false`._ +Otherwise, it SHOULD [1] return `true`. + +[1]: It is not "MUST", to allow the SDKs to have additional experimental features +which causes `Enabled` to return `false`. ## Additional LogRecord interfaces From 62f9071f0a734a7c692310290c7b77454174dd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 17:45:59 +0100 Subject: [PATCH 10/17] Update sdk.md --- specification/logs/sdk.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 600ef8a2b95..028d71f4e3f 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -201,9 +201,7 @@ It consists of the following parameters: - `Logger` is disabled (`LoggerConfig.disabled` is `true`). Otherwise, it SHOULD [1] return `true`. - -[1]: It is not "MUST", to allow the SDKs to have additional experimental features -which causes `Enabled` to return `false`. +It MAY return `false` to support additional experimental features. ## Additional LogRecord interfaces From aff4adf589f1f473a17d637bfbe759314212914a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 18:47:44 +0100 Subject: [PATCH 11/17] Update specification/logs/sdk.md --- specification/logs/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 9431bc24bd0..8eca8801300 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -199,7 +199,7 @@ It consists of the following parameters: - `Logger` is disabled (`LoggerConfig.disabled` is `true`). -Otherwise, it SHOULD [1] return `true`. +Otherwise, it SHOULD return `true`. It MAY return `false` to support additional experimental features. ## Additional LogRecord interfaces From d01279ebcb1a93da94fab26b66f074da5605a5b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 18:50:19 +0100 Subject: [PATCH 12/17] Update sdk.md --- specification/logs/sdk.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 8eca8801300..4a3c9c263a3 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -197,7 +197,8 @@ It consists of the following parameters: `Enabled` MUST return `false` when: -- `Logger` is disabled (`LoggerConfig.disabled` is `true`). +- There is none registered [`LogRecordProcessor`](#logrecordprocessor), +- `Logger` is disabled ([`LoggerConfig.disabled`](#loggerconfig) is `true`). Otherwise, it SHOULD return `true`. It MAY return `false` to support additional experimental features. From 012b7a054938a37c6f91aee2cc063037a6d7c29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 19:08:09 +0100 Subject: [PATCH 13/17] Update sdk.md --- specification/logs/sdk.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 4a3c9c263a3..8cb5f7f4bab 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -197,7 +197,8 @@ It consists of the following parameters: `Enabled` MUST return `false` when: -- There is none registered [`LogRecordProcessor`](#logrecordprocessor), +- it is called after [`LoggerProvider.Shutdown`](#shutdown), +- there is none registered [`LogRecordProcessor`](#logrecordprocessor), - `Logger` is disabled ([`LoggerConfig.disabled`](#loggerconfig) is `true`). Otherwise, it SHOULD return `true`. From cf74ed78b8bf74e07d1f0d18b23d489949f92ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 19:16:18 +0100 Subject: [PATCH 14/17] Update sdk.md --- specification/logs/sdk.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 8cb5f7f4bab..bc21d37b8ed 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -197,12 +197,11 @@ It consists of the following parameters: `Enabled` MUST return `false` when: -- it is called after [`LoggerProvider.Shutdown`](#shutdown), - there is none registered [`LogRecordProcessor`](#logrecordprocessor), - `Logger` is disabled ([`LoggerConfig.disabled`](#loggerconfig) is `true`). Otherwise, it SHOULD return `true`. -It MAY return `false` to support additional experimental features. +It MAY return `false` to support additional optimizations and experimental features. ## Additional LogRecord interfaces From 2cdd354442301a4290f687aebdb33a894af345a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 19:17:31 +0100 Subject: [PATCH 15/17] Update sdk.md --- specification/logs/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index bc21d37b8ed..88438eaed91 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -201,7 +201,7 @@ It consists of the following parameters: - `Logger` is disabled ([`LoggerConfig.disabled`](#loggerconfig) is `true`). Otherwise, it SHOULD return `true`. -It MAY return `false` to support additional optimizations and experimental features. +It MAY return `false` to support additional optimizations and features. ## Additional LogRecord interfaces From 86a298eaa5d70e17e5e72b35b8758ba70e406e21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Wed, 22 Jan 2025 19:27:31 +0100 Subject: [PATCH 16/17] Update specification/logs/sdk.md Co-authored-by: Cijo Thomas --- specification/logs/sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/logs/sdk.md b/specification/logs/sdk.md index 88438eaed91..c77d412e519 100644 --- a/specification/logs/sdk.md +++ b/specification/logs/sdk.md @@ -197,7 +197,7 @@ It consists of the following parameters: `Enabled` MUST return `false` when: -- there is none registered [`LogRecordProcessor`](#logrecordprocessor), +- there are no registered [`LogRecordProcessors`](#logrecordprocessor), - `Logger` is disabled ([`LoggerConfig.disabled`](#loggerconfig) is `true`). Otherwise, it SHOULD return `true`. From 021973edc36ed5aee97de049a6c50361ee306c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Paj=C4=85k?= Date: Thu, 23 Jan 2025 06:48:56 +0100 Subject: [PATCH 17/17] Update specification/logs/noop.md Co-authored-by: Liudmila Molkova --- specification/logs/noop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/logs/noop.md b/specification/logs/noop.md index 6ffb02ee034..b657f700115 100644 --- a/specification/logs/noop.md +++ b/specification/logs/noop.md @@ -61,4 +61,4 @@ for [emitting LogRecords](./api.md#emit-a-logrecord). **Status**: [Development](../document-status.md) -MUST always returns `false`. +MUST always return `false`.