← 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

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.

Suggested action: needs triage

Reason: The issue has no labels, no assignee, and zero maintainer comments, showing no sign of ever being triaged. It is not stale-closable because the reported code (record.getMessage() at messages.py:393) still exists at HEAD and the observation remains valid, though it is a minor consistency nit since the Emitter never sets a formatter on the handler, so there is no user-visible behavior change.

Impact: 10 Quick Win: 8.5 Staleness: 90 Complexity: 15 Confidence: 85 Support Request: 10

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
qwen/qwen3.8-27b
Impact: 10
Quick Win: 8.5
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 15
Confidence: 85
Support Request: 0
close stale _Handler.emit in craft-cli bypasses the assigned formatter, calling record.getMessage() instead of self.format(record). Proposes a default simple formatter or custom format support. Open, unassigned, and inactive for 1237 days.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.