mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-07 02:51:50 +00:00
fix(core): move RedactingFormatter import before conditional block
RedactingFormatter was imported inside 'if not has_errors_log_handler:' (line 461) but also used unconditionally in the verbose_logging block (line 479). When the error log handler already exists (e.g. second AIAgent in the same process) AND verbose_logging=True, the import was skipped and line 479 raised NameError. Fix: Move the import one level up so it's always available regardless of whether the error log handler already exists.
This commit is contained in:
parent
ba728f3e63
commit
c713d01e72
1 changed files with 1 additions and 1 deletions
|
|
@ -457,8 +457,8 @@ class AIAgent:
|
||||||
and Path(getattr(handler, "baseFilename", "")).resolve() == resolved_error_log_path
|
and Path(getattr(handler, "baseFilename", "")).resolve() == resolved_error_log_path
|
||||||
for handler in root_logger.handlers
|
for handler in root_logger.handlers
|
||||||
)
|
)
|
||||||
if not has_errors_log_handler:
|
|
||||||
from agent.redact import RedactingFormatter
|
from agent.redact import RedactingFormatter
|
||||||
|
if not has_errors_log_handler:
|
||||||
error_log_dir.mkdir(parents=True, exist_ok=True)
|
error_log_dir.mkdir(parents=True, exist_ok=True)
|
||||||
error_file_handler = RotatingFileHandler(
|
error_file_handler = RotatingFileHandler(
|
||||||
error_log_path, maxBytes=2 * 1024 * 1024, backupCount=2,
|
error_log_path, maxBytes=2 * 1024 * 1024, backupCount=2,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue