Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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.