Skip to content

Commit

Permalink
Minor PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cretz committed Nov 3, 2023
1 parent 07f7cdc commit 23470eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
21 changes: 1 addition & 20 deletions temporalio/bridge/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import Any, Callable, Dict, Mapping, NewType, Optional, Sequence, Type
from typing import Any, Callable, Dict, Mapping, Optional, Sequence, Type

from typing_extensions import Protocol

Expand Down Expand Up @@ -87,25 +87,6 @@ class TelemetryConfig:
metrics: Optional[MetricsConfig]


BufferedLogLevel = NewType("BufferedLogLevel", int)
"""Representation of a log level for a buffered log entry."""

BUFFERED_LOG_LEVEL_TRACE = BufferedLogLevel(0)
"""Trace log level."""

BUFFERED_LOG_LEVEL_DEBUG = BufferedLogLevel(1)
"""Debug log level."""

BUFFERED_LOG_LEVEL_INFO = BufferedLogLevel(2)
"""Info log level."""

BUFFERED_LOG_LEVEL_WARN = BufferedLogLevel(3)
"""Warn log level."""

BUFFERED_LOG_LEVEL_ERROR = BufferedLogLevel(4)
"""Error log level."""


# WARNING: This must match Rust runtime::BufferedLogEntry
class BufferedLogEntry(Protocol):
"""A buffered log entry."""
Expand Down
4 changes: 1 addition & 3 deletions temporalio/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class LogForwardingConfig:
If for some reason lots of logs occur within the buffered time (i.e.
thousands), they may be sent earlier. Users are discouraged from using this
with ``TRACE`` core logging.
with ``TRACE`` Core logging.
All log records produced have a ``temporal_log`` attribute that contains a
representation of the Core log. This representation has a ``fields``
Expand Down Expand Up @@ -220,8 +220,6 @@ def _on_logs(
# We can't access logging module's start time and it's not worth
# doing difference math to get relative time right here, so
# we'll make time relative to _our_ module's start time
# We are scared of using a private variable here, so we will
# swallow any exceptions
self.relativeCreated = (record.created - _module_start_time) * 1000
# Log the record
self.logger.handle(record)
Expand Down

0 comments on commit 23470eb

Please sign in to comment.