Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Consider the following truncated source file (an empty Quickly application with unnecessary lines stripped):

import logging
logger = logging.getLogger('foobar')

class FoobarWindow(Window):
    __gtype_name__ = "FoobarWindow"

    def finish_initializing(self, builder): # pylint: disable=E1002
        """Set up the main window"""
        super(FoobarWindow, self).finish_initializing(builder)

        # Code for other initialization actions should be added here.
        logger.info("hello world from the logger")

The whole code is already in the quickly template, only the call to logger.info has been added. But I don't see any console output and I have not seen any logfile. Could somebody elaborate on logging practice in applications created with Quickly? Thank you!

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Just add logging.basicConfig(level=logging.INFO) after the import statement.

This will make all log messages being redirected to the terminal. In terms of practices, i think there's nothing specific to Quickly. If you need to tweak other parameters (log to a file instead of console, log format, etc) you can find more info here. Hope it helps.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.