Skip to content

Commit

Permalink
restore format
Browse files Browse the repository at this point in the history
  • Loading branch information
GanymedeNil committed Jun 28, 2023
1 parent eef7ea1 commit f72d854
Showing 1 changed file with 48 additions and 48 deletions.
96 changes: 48 additions & 48 deletions opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ class LogLimits:
UNSET = -1

def __init__(
self,
max_attributes: Optional[int] = None,
max_attribute_length: Optional[int] = None,
self,
max_attributes: Optional[int] = None,
max_attribute_length: Optional[int] = None,
):

# attribute count
Expand All @@ -114,7 +114,7 @@ def __repr__(self):

@classmethod
def _from_env_if_absent(
cls, value: Optional[int], env_var: str, default: Optional[int] = None
cls, value: Optional[int], env_var: str, default: Optional[int] = None
) -> Optional[int]:
if value == cls.UNSET:
return None
Expand Down Expand Up @@ -156,18 +156,18 @@ class LogRecord(APILogRecord):
"""

def __init__(
self,
timestamp: Optional[int] = None,
observed_timestamp: Optional[int] = None,
trace_id: Optional[int] = None,
span_id: Optional[int] = None,
trace_flags: Optional[TraceFlags] = None,
severity_text: Optional[str] = None,
severity_number: Optional[SeverityNumber] = None,
body: Optional[Any] = None,
resource: Optional[Resource] = None,
attributes: Optional[Attributes] = None,
limits: Optional[LogLimits] = _UnsetLogLimits,
self,
timestamp: Optional[int] = None,
observed_timestamp: Optional[int] = None,
trace_id: Optional[int] = None,
span_id: Optional[int] = None,
trace_flags: Optional[TraceFlags] = None,
severity_text: Optional[str] = None,
severity_number: Optional[SeverityNumber] = None,
body: Optional[Any] = None,
resource: Optional[Resource] = None,
attributes: Optional[Attributes] = None,
limits: Optional[LogLimits] = _UnsetLogLimits,
):
super().__init__(
**{
Expand Down Expand Up @@ -229,9 +229,9 @@ class LogData:
"""Readable LogRecord data plus associated InstrumentationLibrary."""

def __init__(
self,
log_record: LogRecord,
instrumentation_scope: InstrumentationScope,
self,
log_record: LogRecord,
instrumentation_scope: InstrumentationScope,
):
self.log_record = log_record
self.instrumentation_scope = instrumentation_scope
Expand Down Expand Up @@ -284,7 +284,7 @@ def __init__(self):
self._lock = threading.Lock()

def add_log_record_processor(
self, log_record_processor: LogRecordProcessor
self, log_record_processor: LogRecordProcessor
) -> None:
"""Adds a Logprocessor to the list of log processors handled by this instance"""
with self._lock:
Expand Down Expand Up @@ -346,16 +346,16 @@ def __init__(self, max_workers: int = 2):
)

def add_log_record_processor(
self, log_record_processor: LogRecordProcessor
self, log_record_processor: LogRecordProcessor
):
with self._lock:
self._log_record_processors += (log_record_processor,)

def _submit_and_wait(
self,
func: Callable[[LogRecordProcessor], Callable[..., None]],
*args: Any,
**kwargs: Any,
self,
func: Callable[[LogRecordProcessor], Callable[..., None]],
*args: Any,
**kwargs: Any,
):
futures = []
for lp in self._log_record_processors:
Expand Down Expand Up @@ -437,9 +437,9 @@ class LoggingHandler(logging.Handler):
"""

def __init__(
self,
level=logging.NOTSET,
logger_provider=None,
self,
level=logging.NOTSET,
logger_provider=None,
) -> None:
super().__init__(level=level)
self._logger_provider = logger_provider or get_logger_provider()
Expand Down Expand Up @@ -509,13 +509,13 @@ def flush(self) -> None:

class Logger(APILogger):
def __init__(
self,
resource: Resource,
multi_log_record_processor: Union[
SynchronousMultiLogRecordProcessor,
ConcurrentMultiLogRecordProcessor,
],
instrumentation_scope: InstrumentationScope,
self,
resource: Resource,
multi_log_record_processor: Union[
SynchronousMultiLogRecordProcessor,
ConcurrentMultiLogRecordProcessor,
],
instrumentation_scope: InstrumentationScope,
):
super().__init__(
instrumentation_scope.name,
Expand All @@ -540,17 +540,17 @@ def emit(self, record: LogRecord):

class LoggerProvider(APILoggerProvider):
def __init__(
self,
resource: Resource = Resource.create(),
shutdown_on_exit: bool = True,
multi_log_record_processor: Union[
SynchronousMultiLogRecordProcessor,
ConcurrentMultiLogRecordProcessor,
] = None,
self,
resource: Resource = Resource.create(),
shutdown_on_exit: bool = True,
multi_log_record_processor: Union[
SynchronousMultiLogRecordProcessor,
ConcurrentMultiLogRecordProcessor,
] = None,
):
self._resource = resource
self._multi_log_record_processor = (
multi_log_record_processor or SynchronousMultiLogRecordProcessor()
multi_log_record_processor or SynchronousMultiLogRecordProcessor()
)
self._at_exit_handler = None
if shutdown_on_exit:
Expand All @@ -561,10 +561,10 @@ def resource(self):
return self._resource

def get_logger(
self,
name: str,
version: Optional[str] = None,
schema_url: Optional[str] = None,
self,
name: str,
version: Optional[str] = None,
schema_url: Optional[str] = None,
) -> Logger:
return Logger(
self._resource,
Expand All @@ -577,7 +577,7 @@ def get_logger(
)

def add_log_record_processor(
self, log_record_processor: LogRecordProcessor
self, log_record_processor: LogRecordProcessor
):
"""Registers a new :class:`LogRecordProcessor` for this `LoggerProvider` instance.
Expand Down

0 comments on commit f72d854

Please sign in to comment.