How to handle error logging

Hi all, I’m building my own plugins (just for personal use) and I’m really struggling with debugging.

Obviously there is no console log like there would normally be, so I normally use journalctl to see where errors are happening in my code. The two problems here are that

a) everything else for the whole system is being output here so I have to use grep commands to see just one plugin’s out put
b) (the bigger problem) when errors happen, it doesn’t tell me what they are, just what line they occurred on.

Am I being stupid here? Where should I look to see normal error debugging?

I tried try / catch statemetns, but the error messages just don’t get passed through.

Any help would be really appreciated!

First : please do not open several thread for a single question…

journalctl -f

return what you need

This is a different question so I put it in a new thread

As I said above, I have been using journalctl - but it doesn’t return the error message, just the line that the error is on.

How can I see the actual error messages?