Skip to content

f-String Logging in Multiple Locations #140

@CyberSecDef

Description

@CyberSecDef

Problem

Several log statements use f-strings instead of parameterized logging:

  • novelforge/routes/sessions.py lines 68, 70
  • novelforge/__init__.py line 238

The rest of the codebase consistently uses logger.info("msg %s", var).

Why It Matters

  • f-strings are eagerly formatted even if the log level is disabled
  • Structured logging tools cannot group f-string messages by template
  • Inconsistent with codebase conventions

Recommended Fix

logger.info("Deleted session file %s", session_file)
logger.error("Failed to delete session file: %s", e)
logger.warning("LLM log file not found at %s", log_path)

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions