aboutsummaryrefslogtreecommitdiffstats
path: root/pylog/onaplogging/marker
diff options
context:
space:
mode:
authorliangke <lokyse@163.com>2018-09-11 16:37:09 +0800
committerliangke <lokyse@163.com>2018-09-11 17:05:10 +0800
commite00f8c9d9fc89f3de7f324704b3bd02c976e21e9 (patch)
tree6c98c572bfb6e1f35bd9dd5f5aef7a06068d5a42 /pylog/onaplogging/marker
parent8dff758d560d3acdbd21a2ea11f4ba5a5ede1ff0 (diff)
Enable colored output for loggingLOG-380-shared
ColorFormatter class uses ANSI esacpe sequences to render logging message in color, it uses standard colors so it should workd on any UNIX terminal. Make markerFormatter class to inherits from colorFormatter. Change-Id: Ie24a06df861ca5d07796e78dea7e875daf149380 Issue-ID: MULTICLOUD-329 Signed-off-by: liangke <lokyse@163.com>
Diffstat (limited to 'pylog/onaplogging/marker')
-rw-r--r--pylog/onaplogging/marker/markerFactory.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pylog/onaplogging/marker/markerFactory.py b/pylog/onaplogging/marker/markerFactory.py
index deb9566..e7b00b9 100644
--- a/pylog/onaplogging/marker/markerFactory.py
+++ b/pylog/onaplogging/marker/markerFactory.py
@@ -51,12 +51,12 @@ class MarkerFactory(IMarkerFactory):
if marker_name is None:
raise ValueError("not empty")
+ lock.acquire()
marker = self._marker_map.get(marker_name, None)
if marker is None:
- lock.acquire()
marker = BaseMarker(name=marker_name)
self._marker_map[marker_name] = marker
- lock.release()
+ lock.release()
return marker