Skip to content
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

Stuck figuring out how to get ideolog working? read this #193

Open
Not-a-cowfr opened this issue Sep 5, 2024 · 2 comments
Open

Stuck figuring out how to get ideolog working? read this #193

Not-a-cowfr opened this issue Sep 5, 2024 · 2 comments

Comments

@Not-a-cowfr
Copy link

Instead of you trying to figure out how to work this for 4 hours straight like i did, read this (hopefully) helpful explanation of what i did

Here's how I have mine set up to look
image
note that my format is HH:mm:ss [<log>] | <message>

And here's how I did that in python

import logging as log
formatter = log.Formatter('%(asctime)s [%(levelname)s] | %(message)s', datefmt='%H:%M:%S')

First, make a new Log Format
image
The regex that I used is ^(\d{2}:\d{2}:\d{2})\s(\[[A-Z]*\])(\s\|\s)(.*)$
link to how my regex works

Then add all the colors for the patterns that you want, here's how I have mine

[WARNING] ^.*\s*(\[WARNING\]).*
image

[ERROR] ^.*\s*(\[ERROR\]).*
image

[FATAL] ^.*\s*(\[FATAL\]).*
image

[INFO] ^.*\s*(\[INFO\]).*
image

[DEBUG] ^.*\s*(\[DEBUG\]).*
image

[TRACE]/[TRACEBACK] ^.*\s*(\[TRACE|TRACEBACK\]).*
image

Timestamp ^(\d{2}:\d{2}:\d{2})
image

Helpful tips

  1. I cannot stress enough how much regex101 saved me while I was doing this, i quite literally learned how regex works with this

  2. Ideolog uses a very unusual implementation of regex, meaning that something that would work literally anywhere else, might not work with this, for example, ending your regex with /i to make everything case insensitive, does not work

  3. If you think something should have changed, but doesn't, try restarting your ide

if you have any questions that I might have left out, reply here, if I don't respond after a while, dm me on discord not_a_cow

@bedge
Copy link

bedge commented Sep 12, 2024

Thanks for this. Appreciate the effort. This experience really does make one feel like a bit of an idiot.

2 questions if I may

  1. Any hints on testing?
    I still get the "Log format not recognized" and I'm pretty sure I have a match.
    regex101 says it works but there's no indication

  2. Got it working through sheer dumb luck, but now I can't find the config anymore.
    I was navigating to the idealog config earlier only because O was getting the "Log format not recognized" error on opening log files.
    But now that I have a valid format, the error's gone and I can't find the settings.

@smirok
Copy link
Contributor

smirok commented Nov 11, 2024

Hi @Not-a-cowfr @bedge! Thank you for your instructions and comments.

Have you tried using the tips from the wiki documentation? If so, were they useful to you?

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

No branches or pull requests

3 participants