gajim --loglevel <logging directives> Logging directives ::= Directive[,Directive[,…]] Directive ::= Logspec=LEVEL Logspec ::= logger[=logger[=…]] LEVEL ::= Level name in uppercase, as listed in . Custom levels are recognized, provided that they are in all uppercase. - or - Level number. Does not need to match an existing level.
Of course you need to fill in the real name of the logger.
And that's it! Now you can write "log.debug("blahblah")" instead of "gajim.log.debug("blahblah")".
If you write a new module and inherit from BaseModule use the logging adapter of the BaseModule class
This will add the current account to every log message
Hierarchy and Naming
Loggers are hierarchical, and are named (in Gajim) according to the file and directory structure.
For example, the logger for transports is named:
gajim.c.x.transports │ │ │ └────── Logger for common/xmpp/transports, sublogger of xmpp. │ │ └────────────── xmpp, sublogger of common. Everything in common/xmpp goes through this logger │ └──────────────── common, sublogger of gajim. Everything in common/ goes through this logger. └──────────────────── Gajim's root logger. All new-style log messages pass through here.
Names of subdirectories are shortened to their first letter, to avoid overlong log lines.
When a message is generated, the logger checks its own level. If the logger's
level is unset, it will look at its parent's level, and so on, until a logger
with a set level is found. So if the level of transports has been set to
DEBUG, this is its resulting level, and the parents will not be checked. By
default all loggers are unset, except the gajim root, which is set to WARNING.
The message will be shown if its level is greater or equal to the logger's