Sublime Forum

Logging in own plugin doesn't work - how to activate it?

#1

Currently I try to add logging to my plugin that I am developing.

I added the following statement at the top, but it doesn’t produce any output. Does the logging module work within plugins?

import logging

logging.basicConfig(level=logging.DEBUG, format=' %(asctime)s - %(levelname)s - %(message)s')
logging.debug('Start of program')
0 Likes

#2

Works fine here. I see this in my console:

2017-08-26 23:05:25,253 - DEBUG - Start of program
0 Likes

#3

I suggest directly adding a handler for your package and creating logger instances for each module. You can see an example in PackageDev’s _logging.py:

0 Likes