Skip to content

Commit

Permalink
rename ConsoleExporter to ConsoleLogExporter (#2307)
Browse files Browse the repository at this point in the history
* rename ConsoleExporter to ConsoleLogExporter

* update changelog
  • Loading branch information
Alex Boten authored Dec 3, 2021
1 parent 46f77d0 commit 8bbaf76
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion opentelemetry-sdk/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def shutdown(self):
"""


class ConsoleExporter(LogExporter):
class ConsoleLogExporter(LogExporter):
"""Implementation of :class:`LogExporter` that prints log records to the
console.
Expand Down
8 changes: 4 additions & 4 deletions opentelemetry-sdk/tests/logs/test_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
from opentelemetry.sdk._logs.export import (
BatchLogProcessor,
ConsoleExporter,
ConsoleLogExporter,
SimpleLogProcessor,
)
from opentelemetry.sdk._logs.export.in_memory_log_exporter import (
Expand Down Expand Up @@ -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(
Expand All @@ -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.

Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions opentelemetry-sdk/tests/test_configurator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__
)

0 comments on commit 8bbaf76

Please sign in to comment.