Skip to content

Commit 51a606e

Browse files
committed
opentelemetry-api: review get_logger documentation
1 parent a96a3d6 commit 51a606e

File tree

1 file changed

+10
-10
lines changed
  • opentelemetry-api/src/opentelemetry/_logs/_internal

1 file changed

+10
-10
lines changed

opentelemetry-api/src/opentelemetry/_logs/_internal/__init__.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,29 +162,29 @@ def get_logger(
162162
) -> Logger:
163163
"""Returns a `Logger` for use by the given instrumentation library.
164164
165-
For any two calls it is undefined whether the same or different
166-
`Logger` instances are returned, even for different library names.
165+
Calls with the same arguments should return the same `Logger` instance.
167166
168167
This function may return different `Logger` types (e.g. a no-op logger
169168
vs. a functional logger).
170169
171170
Args:
172-
name: The name of the instrumenting module.
173-
``__name__`` may not be used as this can result in
174-
different logger names if the loggers are in different files.
175-
It is better to use a fixed string that can be imported where
176-
needed and used consistently as the name of the logger.
177-
178-
This should *not* be the name of the module that is
179-
instrumented but the name of the module doing the instrumentation.
171+
name: The name of the instrumenting module, package or class.
172+
This should *not* be the name of the module, package or class that is
173+
instrumented but the name of the code doing the instrumentation.
180174
E.g., instead of ``"requests"``, use
181175
``"opentelemetry.instrumentation.requests"``.
182176
177+
For log sources which define a logger name (e.g. logging.Logger.name)
178+
the Logger Name should be recorded as the instrumentation scope name.
179+
183180
version: Optional. The version string of the
184181
instrumenting library. Usually this should be the same as
185182
``importlib.metadata.version(instrumenting_library_name)``.
186183
187184
schema_url: Optional. Specifies the Schema URL of the emitted telemetry.
185+
186+
attributes: Optional. Specifies the instrumentation scope attributes to
187+
associate with emitted telemetry.
188188
"""
189189

190190

0 commit comments

Comments
 (0)