Skip to content

How to get the file and name of the log line #40

@river-walras

Description

@river-walras

I want a custome output to get the line and the file of the output log. I tried

logger.set_pattern("[%Y-%m-%d %H:%M:%S.%e] [%n] [%^%l%$] [%@] %v")

However, the [%@] seems not working, I know I can using inspect, but it is not a performant way

I expected to get

[2024-12-30 16:03:42.268] [test] [critical] [your_script.py:123] This is a critical message

But the line and file braket is always empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions