spdlog-python icon indicating copy to clipboard operation
spdlog-python copied to clipboard

How to get the file and name of the log line

Open river-walras opened this issue 11 months ago • 0 comments

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.

river-walras avatar Dec 30 '24 16:12 river-walras