Skip to content

Make logger use file path and line instead having to provide name #313

@GDYendell

Description

@GDYendell

Currently developers have to provide a name so that the source of log messages is clear:

from fastcs.logging import bind_logger

logger = bind_logger(name=__name__)

logger.info("Here")
[2026-01-27 16:52:44.829+0000 I] Here [transports.epics.ca.transport]

Acceptance Criteria

We should have the file path and line number by default to make logger usage easier and more useful

from fastcs.logging import logger

logger.info("Here")
[2026-01-27 16:52:44.829+0000 I] Here [/workspaces/FastCS/src/fastcs/transports/epics/ca/transport.py:47]

This is not as neat, but it is more useful for debugging.


In format_record, we can access record["file"].path.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions