diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f0cf21c606..cd154b753cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ([#2303](https://github.com/open-telemetry/opentelemetry-python/pull/2303)) - Adding entrypoints for log emitter provider and console, otlp log exporters ([#2253](https://github.com/open-telemetry/opentelemetry-python/pull/2253)) +- Rename ConsoleExporter to ConsoleLogExporter + ([#2307](https://github.com/open-telemetry/opentelemetry-python/pull/2307)) ## [1.7.1-0.26b1](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.7.0-0.26b0) - 2021-11-11 diff --git a/opentelemetry-sdk/setup.cfg b/opentelemetry-sdk/setup.cfg index a8025965004..e78448dd820 100644 --- a/opentelemetry-sdk/setup.cfg +++ b/opentelemetry-sdk/setup.cfg @@ -57,7 +57,7 @@ opentelemetry_traces_exporter = opentelemetry_log_emitter_provider = sdk_log_emitter_provider = opentelemetry.sdk._logs:LogEmitterProvider opentelemetry_logs_exporter = - console = opentelemetry.sdk._logs.export:ConsoleExporter + console = opentelemetry.sdk._logs.export:ConsoleLogExporter opentelemetry_id_generator = random = opentelemetry.sdk.trace.id_generator:RandomIdGenerator opentelemetry_environment_variables = diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py index c705c2b2497..87ac308317d 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py @@ -63,7 +63,7 @@ def shutdown(self): """ -class ConsoleExporter(LogExporter): +class ConsoleLogExporter(LogExporter): """Implementation of :class:`LogExporter` that prints log records to the console. diff --git a/opentelemetry-sdk/tests/logs/test_export.py b/opentelemetry-sdk/tests/logs/test_export.py index 45b83358f93..502c68ed759 100644 --- a/opentelemetry-sdk/tests/logs/test_export.py +++ b/opentelemetry-sdk/tests/logs/test_export.py @@ -31,7 +31,7 @@ ) from opentelemetry.sdk._logs.export import ( BatchLogProcessor, - ConsoleExporter, + ConsoleLogExporter, SimpleLogProcessor, ) from opentelemetry.sdk._logs.export.in_memory_log_exporter import ( @@ -321,7 +321,7 @@ def _target(): log_processor.shutdown() -class TestConsoleExporter(unittest.TestCase): +class TestConsoleLogExporter(unittest.TestCase): def test_export(self): # pylint: disable=no-self-use """Check that the console exporter prints log records.""" log_data = LogData( @@ -341,7 +341,7 @@ def test_export(self): # pylint: disable=no-self-use "first_name", "first_version" ), ) - exporter = ConsoleExporter() + exporter = ConsoleLogExporter() # Mocking stdout interferes with debugging and test reporting, mock on # the exporter instance instead. @@ -362,7 +362,7 @@ def formatter(record): # pylint: disable=unused-argument return mock_record_str mock_stdout = Mock() - exporter = ConsoleExporter(out=mock_stdout, formatter=formatter) + exporter = ConsoleLogExporter(out=mock_stdout, formatter=formatter) log_data = LogData( log_record=LogRecord(), instrumentation_info=InstrumentationInfo( diff --git a/opentelemetry-sdk/tests/test_configurator.py b/opentelemetry-sdk/tests/test_configurator.py index 8a4aadd4790..ca755544b76 100644 --- a/opentelemetry-sdk/tests/test_configurator.py +++ b/opentelemetry-sdk/tests/test_configurator.py @@ -28,7 +28,7 @@ _import_id_generator, _init_tracing, ) -from opentelemetry.sdk._logs.export import ConsoleExporter +from opentelemetry.sdk._logs.export import ConsoleLogExporter from opentelemetry.sdk.resources import SERVICE_NAME, Resource from opentelemetry.sdk.trace.export import ConsoleSpanExporter from opentelemetry.sdk.trace.id_generator import IdGenerator, RandomIdGenerator @@ -193,5 +193,5 @@ def test_console_exporters(self): trace_exporters["console"].__class__, ConsoleSpanExporter.__class__ ) self.assertEqual( - logs_exporters["console"].__class__, ConsoleExporter.__class__ + logs_exporters["console"].__class__, ConsoleLogExporter.__class__ )