Closed peter-gy closed 6 months ago
I would also like for this to be a feature
Yes me too
Thank you so much
i think i must be using this wrong?
i installed loguru and it logs fine, viewing log pycharm complains unknown format, i click 'configure log formats' -> import and select the provided xml. it seems to import fine, is enabled, but pycharm still complaining and no highlighting? restarted pycharm but same
import pytest
from loguru import logger
logger.add('test.log')
@pytest.mark.asyncio
async def test_log():
logger.info("test")
def test_re():
import re
with open("test.log", "r") as f:
LOG1 = f.readline()
pat_xml = r"^(\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\.\d{3}\s)\|(\s[A-Z]*\s*)\|(\s.+:.+:\d+\s-\s.*)$"
match = re.match(pat_xml, LOG1)
assert match
print("Match found!")
print("Groups:", match.groups())
ideolog settings here tests pass so the regex is matching correctly?
Added in #168. Will be released in the next version. Thanks for your feedback!
In PyCharm, it would provide an extremely nice Developer Experience to have support for the default
loguru
format.Currently it looks rather unattractive: