Python Logging Formatting Improvements
authorDave Tucker <dave@dtucker.co.uk>
Sun, 30 Mar 2014 11:26:55 +0000 (12:26 +0100)
committerBen Pfaff <blp@nicira.com>
Mon, 28 Apr 2014 16:09:04 +0000 (09:09 -0700)
commita5ed8fe32cb3c996837c61af2e358fa34dc9936f
tree40df5cd889fd0686a9a9b02ec2365dd9d01a5c70
parent6a5f9a8fbdfa85795101b46ee1047dfd2b1007c6
Python Logging Formatting Improvements

The Open vSwitch daemons written in C support user-configured logging
patterns as described in ovs-appctl(8). This commit adds this capability
to the daemons written in Python.

- Add a '__log_patterns' attribute to the Vlog class
- Populate this using the default patterns in ovs-appctl(8)
- Add a '__start_time' attribute to the Vlog class to support '%r'
- Update the '_log' method to build the log message according to the
  pattern
- Add a 'set_pattern' method to allow the default patterns to be changed
- Update 'set_levels_from_string' to support setting the pattern from a
  string

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS
NEWS
lib/vlog.man
python/ovs/vlog.py
tests/vlog.at