JetBrains / ideolog

Interactive viewer for '.log' files.
MIT License
252 stars 54 forks source link

Support WordPress debug.log #111

Open codestylist opened 3 years ago

codestylist commented 3 years ago

I would request the enhancement to include support for the WordPress debug.log format. Hope it is possible. Thanks!

fearlex commented 2 years ago

+1

harlet commented 2 years ago

You must update the patters like this: ^\s*[E|e](rror)?[:|\s]*$ ^\s*[W|w](arn(ing)?)?[:|\s]*$ ^\s*[I|i](nfo)?(:|\s)*$ ^\s*[N|n](otice)?(:|\s)*$

fearlex commented 2 years ago

You must update the patters like this: ^\s*[E|e](rror)?[:|\s]*$ ^\s*[W|w](arn(ing)?)?[:|\s]*$ ^\s*[I|i](nfo)?(:|\s)*$ ^\s*[N|n](otice)?(:|\s)*$

Thank you for this. While it is useful, it is still not completed and still hard to read.

CleanShot 2022-05-17 at 11 39 44@2x
harlet commented 2 years ago

Thank you for this. While it is useful, it is still not completed and still hard to read.

Make sure you select Highligh Line.

fearlex commented 2 years ago

Thank you for this. While it is useful, it is still not completed and still hard to read.

Make sure you select Highligh Line.

Thank you. Looks better

CleanShot 2022-05-17 at 12 14 46@2x
codestylist commented 2 years ago

With some modification of the color it works like a charm. Thank you @harlet !

contactjavas commented 9 months ago

You must update the patters like this: ^\s*[E|e](rror)?[:|\s]*$ ^\s*[W|w](arn(ing)?)?[:|\s]*$ ^\s*[I|i](nfo)?(:|\s)*$ ^\s*[N|n](otice)?(:|\s)*$

Hi @harlet & @fearlex , sorry for mentioning you both 🙏 Tried those patterns, but couldn't manage it to work. Maybe I'm doing it in-correctly?

image
wayheming commented 7 months ago

Hello @contactjavas, have you found a solution?

marcdegagne commented 3 months ago

Hey all,

I am also having some troubles making this work for WordPress error logs. Note that I have not tried the other like Laravel.

One thing I found is when some chages are made to the "Log Formats", we need to close and reopen back the IDE completely, in my case PHPStorm. The log formats are probably loaded at opening. This does not apply to the "Patterns". Maybe there is a way to invalidate it, but I do not know it...

I am not a pro with regex and I am using Regex 101 to test outside Ideolog to make sure the regex are working. The following regex formula works, but not with Ideolog. Log Format : Message pattern : ^\[([^]]+)\]\s+([\w\s]+:)\s+(.+)$ Message sart pattern : ^\[ Time format : dd-mm-yyyy HH:mm:ss

This regex creates a 3 groups. One for the date and time including the brackets , the second to capture the errors/warning/notice... and the last one, the message.

The message : [22-Mar-2024 18:33:10 UTC] PHP Notice: La fonction map_meta_cap a été appelée de façon incorrecte. Lors de la vérification de la fonctionnalité edit_comment, vous devez toujours la comparer à un commentaire spécifique. Veuillez lire Débogage dans WordPress (en) pour plus d’informations. (Ce message a été ajouté à la version 6.1.0.) in /home/.../***.com/wp-includes/functions.php on line 6031

Group 1 should be the date and time. \[([^]]+)\] Group 2 should be the notice it self. \s+(PHP\s[N|n]otice:)\s+ Group 3 should be the message.

I have tested so many possibliites of patterns and patterns options (field & match), I am out of options. I think this plugin does not work as expected. I got some colors but it was not matching what would be expected.