Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Logging and debug levels?

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Logging and debug levels?

Post by Bartman »

I want to add some functionality to get more infos if users encounter some problems.
What is the EG way to do this?

After a quick look at the code I found the eg.LogIt function but what is the '@' before the call.
What is the difference between the debug and the debug2 command line parameter?

I found the easy code fragement

Code: Select all

if eg.debugLevel:
    print "xyz"
On other occasions I found the PrintDebugNotice function which seems to be defined depending on the debugLevel.
I guess there are no different debug levels (INFO, DEBUG, WARN, ERROR, FATAL) as I know them from log4j?

little confused.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Logging and debug levels?

Post by Bitmonster »

@ is a Python function decorator: http://www.python.org/dev/peps/pep-0318/
Generally use @LogIt, @LogItWithReturn and the function PrintDebugNotice if you think the info should stay there for future debugging. There are no log-levels.

-debug2 is only used if the code is run inside the eclipse/pydev IDE, since it uses some special hooks for stdout/stderr handling. If you develop on another IDE use -debug.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
Post Reply