I like to use a formatter to get a little more display control:
import logging
from exos import api
logHandler = api.TraceBufferHandler("mybuf", 20480)
logHandler.setFormatter(logging.Formatter(
'%(levelname)s:%(threadName)s:%(name)s:%(funcName)s.%(lineno)s:: '
'%(message)s'))
logHandler.setLevel(logging.DEBUG)
logger = logging.getLogger("myapp")
logger.setLevel(logging.DEBUG)
logger.addHandler(logHandler)
if __name__ == '__main__':
try:
logger.debug("Here is a long entry that cannot be seen")
except BaseException, e:
logger.debug("Exception on startup, {}".format(e), exc_info=True)
10/12/2016 18:03:33.330487 [183]
pyext_epm.c.48:: EPM message 24880
10/12/2016 18:03:33.330512 [184] pyext_epm.c.48:: EPM message 536941329
10/12/2016 18:03:33.379564 [185] TestPython: request_standby_config Skipped
10/12/2016 18:03:33.494495 [186] Begin trace buffer
10/12/2016 18:03:33.494901 [187] Begin trace buffer
10/12/2016 18:03:33.495707 [188] DEBUG:ExpyRunner:myapp:.16:: Here is a long entry that cannot be seen
10/12/2016 18:03:34.279345 [189] dmSend: 0044 Peer 4, DM_MSG_OBJ_INFO, Obj 50000000, 104, 0x41b88c