demos/demobase.py
author Radek Brich <radek.brich@devl.cz>
Thu, 27 Mar 2014 08:03:51 +0100
changeset 93 c1e79acb9fcb
parent 92 b97c4e25ed6d
child 96 68c562e0eb1f
permissions -rw-r--r--
Add Layout, FixedLayout.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
92
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
import sys
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
sys.path.append('..')
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
import logging
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
# Setup logging
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
logger = logging.getLogger('tuikit')
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
logger.setLevel(logging.DEBUG)
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     9
handler = logging.FileHandler(filename='tuikit.log')
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
handler.setLevel(logging.DEBUG)
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
formatter = logging.Formatter('%(asctime)s %(name)s %(levelname)s %(message)s')
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
handler.setFormatter(formatter)
b97c4e25ed6d Configure logging for demos.
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
logger.addHandler(handler)