← Back to issue list

logging handler is not using any formater

View original Github issue

Metadata

Project
craft-cli
Number
#135
Type
issue
State
open
Author
rgildein
Labels
—
Created
Updated
Closed
—

Current evaluation

Enhancement request: craft_cli _Handler.emit uses record.getMessage() and ignores self.formatter, so log format can't be customised. Confirmed still unfixed at current HEAD; no maintainer response or labels.

Suggested action: needs triage

Reason: The report is still accurate: craft_cli/messages.py:395 still does `text = record.getMessage()` with no `setFormatter` call anywhere in the repo, and a pickaxe search for `self.format(record)` across all history returns no commits, so nothing fixed it. Impact is minor (a default identity formatter would reproduce today's output, so this is a nicety for consumers who want custom formats), but the exact public API for supplying a format is unspecified since `_Handler` is private and only attached to the root logger at messages.py:511. Despite being open 1344 days with zero comments, no labels and no assignee, it is not stale — the code path is alive — so it has simply never been triaged by a maintainer.

Evaluated by: mr-cal-bot

Impact: 28 Quick Win: 13 Complexity: 20 Confidence: 78 Actionability: 60

Issue body

Currently [`_Handler.emit`](https://github.com/canonical/craft-cli/blob/5e01d366976509d70869e52d9266d4af191e8a8a/craft_cli/messages.py#L328) function is not using `self.formatter` to format message, so instead of `msg = self.format(record)` only `msg = record.getMessage()` is used. I think that by default [`_Handler`](https://github.com/canonical/craft-cli/blob/5e01d366976509d70869e52d9266d4af191e8a8a/craft_cli/messages.py#L316) could use formatter with simple `%(message)s`, but it could be useful to add custom format here.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 28
Quick Win: 13
Complexity: 20
Confidence: 78
Actionability: 60
needs triage Enhancement request: craft_cli _Handler.emit uses record.getMessage() and ignores self.formatter, so log format can't be customised. Confirmed still unfixed at current HEAD; no maintainer response or labels.
stealth/space-bunny-alpha
Impact: 28
Quick Win: 15
Complexity: 18
Confidence: 86
Actionability: 66
needs triage Enhancement request: _Handler.emit in craft_cli/messages.py uses record.getMessage() and ignores self.formatter, so users cannot customize log message format; still present at current HEAD.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 22
Complexity: 10
Confidence: 80
Actionability: 80
needs triage The _Handler.emit method ignores assigned formatters by using record.getMessage() instead of self.format(record). The issue is valid but unlabelled and has no maintainer response.
qwen/qwen3.8-27b
Impact: 10
Quick Win: 8
Staleness: 90
Complexity: 15
Confidence: 85
Support Request: 10
needs triage craft-cli's _Handler.emit uses record.getMessage() instead of self.format(record), ignoring any formatter set on the handler. Code unchanged at HEAD; no labels, no maintainer response, 0 comments in 1312 days.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 15
Confidence: 70
Support Request: 5
needs triage _Handler.emit in craft-cli ignores the configured formatter, using record.getMessage() instead of self.format(record). Untriaged, inactive for over 3 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 20
Confidence: 80
Support Request: 5
close stale Bug report stating the internal logging handler emit method ignores the formatter, using getMessage instead. Issue is 3.5 years old with no maintainer response or updates.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.