Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
River-Shi opened this issue Dec 30, 2024 · 0 comments
Open

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

River-Shi opened this issue Dec 30, 2024 · 0 comments

Comments

@River-Shi
Copy link

River-Shi commented Dec 30, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant