logger: reuse logger_or_root, dedupe optional-logger-arg pattern

This commit is contained in:
Andrej730
2026-07-16 16:58:55 +05:00
parent 2155e3206f
commit 9213b31235
5 changed files with 72 additions and 16 deletions
@@ -1058,6 +1058,7 @@ class file:
instantiate_typed_instances: bool
def key_value_store_iter(self, prefix): ...
def key_value_store_query(self, key): ...
def logger(self) -> logger: ...
def process_deletion_inverse(self, inst): ...
def recalculate_id_counter(self): ...
def remove(self, entity: entity_instance) -> None: ...
@@ -1201,6 +1202,51 @@ class line_segment:
def size(self): ...
def swap(self, v): ...
class log_message:
code: Any
instance: Any
message: Any
product: Any
severity: Any
timestamp: Any
def __init__(self, severity, code_prefix, code_number, timestamp, message, inst=None, current_product=None): ...
@property
def severity_string(self): ...
def to_dict(self): ...
def to_tuple(self): ...
class logger:
FMT_PLAIN: Literal[0]
FMT_JSON: Literal[1]
FMT_INMEMORY: Literal[2]
LOG_PERF: Literal[0]
LOG_DEBUG: Literal[1]
LOG_NOTICE: Literal[2]
LOG_WARNING: Literal[3]
LOG_ERROR: Literal[4]
@staticmethod
def Root() -> logger: ...
def Append(self, logger): ...
def ClearLog(self): ...
def Error(self, *args): ...
def GetLog(self): ...
def MaxSeverity(self): ...
def Message(self, *args): ...
def Notice(self, *args): ...
def OutputFormat(self, *args): ...
def PrintPerformanceStats(self): ...
def PrintPerformanceStatsOnElement(self, *args): ...
def ProgressBar(self, progress): ...
def SetOutput(self, *args): ...
def SetProduct(self, product): ...
def Status(self, message, new_line=True): ...
def Verbosity(self, *args): ...
def Warning(self, *args): ...
def log_messages(self) -> tuple[log_message, ...]: ...
class loft:
axis: Any
def calc_hash(self): ...
@@ -1721,7 +1767,7 @@ def kind_to_string(k): ...
def less(arg1, arg2): ...
def line_segments_to_polygons(s, eps, segments): ...
def map_shape(settings, instance): ...
def logger_or_root(logger): ...
def logger_or_root(logger) -> logger: ...
def nary_union(sequence): ...
def new_IfcBaseClass(schema_identifier: str, name: str) -> entity_instance: ...
def open(fn: str, readonly: bool = False, logger=None) -> file: ...