Skip to content

Commit

Permalink
bump_version
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Sep 23, 2024
1 parent cee7c20 commit f8449b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev20"
version = "0.0.0.dev21"
name = "LoggerMan"
dependencies = [
"MDit == 0.0.0.dev8",
"ActionMan == 0.0.0.dev16",
"ActionMan == 0.0.0.dev17",
"ProtocolMan == 0.0.0.dev2",
"pydantic",
"rich",
Expand Down
20 changes: 14 additions & 6 deletions src/loggerman/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self):
self._curr_list_key: str | None = None
self._prefix_caller_name: str = ""
self._prefix_time: str = ""
self._actionman_logger: _actionman.log.Logger | None = None
return

@property
Expand All @@ -76,7 +77,7 @@ def report(self) -> _mdit.Document:
def initialize(
self,
realtime_levels: Sequence[str | int | LogLevel] | None = None,
console_config: _mdit.target.rich.ConsoleConfig | dict = _mdit.target.rich.ConsoleConfig(),
console_config: _mdit.target.rich.ConsoleConfig | dict | None = None,
github: bool | None = None,
github_debug: bool = True,
title_number: int | _Sequence[int] = 1,
Expand Down Expand Up @@ -177,13 +178,20 @@ def process_exit_code():
self._target_configs_rich = target_configs_rich
self._target_default_md = target_default_md
self._target_default_rich = target_default_rich
if isinstance(console_config, dict):
console_config = _mdit.target.rich.ConsoleConfig(**console_config)
in_github = github if github is not None else _actionman.in_gha()
self._github = in_github
if console_config is None:
console_config = _mdit.target.rich.ConsoleConfig(
color_system="truecolor" if in_github else "auto",
force_terminal=True if in_github else None,
width=91 if in_github else None,
)
elif isinstance(console_config, dict):
console_config = _mdit.target.rich.ConsoleConfig(**console_config)
self._console = console_config.make(
force_terminal=True if in_github else console_config.force_terminal
)
self._actionman_logger = _actionman.log.Logger(console=self._console)
self._list_entries = list_entries
self._curr_list_key = current_list_key
self._prefix_caller_name = prefix_caller_name
Expand Down Expand Up @@ -602,7 +610,7 @@ def _submit_log(
# In GitHub
if level_name not in self._realtime_levels:
# GHA Debug
_actionman.log.debug(output_console)
self._actionman_logger.debug(output_console)
return
dropdown_rich = dropdown.source(target="console", filters=["console"])
group_title = dropdown_rich.title
Expand All @@ -613,7 +621,7 @@ def _submit_log(
group_title = sec_num
annotation_type = self._get_github_annotation_type(level.level)
if annotation_type:
_actionman.log.annotation(
self._actionman_logger.annotation(
typ=annotation_type,
message="See the logs for details.",
title=title,
Expand All @@ -623,7 +631,7 @@ def _submit_log(
column_start=column,
column_end=column_end,
)
_actionman.log.group(
self._actionman_logger.group(
dropdown_rich,
title=group_title,
)
Expand Down

0 comments on commit f8449b0

Please sign in to comment.