summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-02-01 23:11:03 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-02-01 23:57:13 +0900
commit9f30e7d23ad5f43468ed011f58fb727e39137d7d (patch)
treeb0db25097ff99a588b11198131de65b8b78f0596
parentbd074ef2b395fde0d5306b2f65ee33acab11bebc (diff)
allow application to specify its logger name
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/base/app_manager.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py
index 6fb6013b..d380d8c4 100644
--- a/ryu/base/app_manager.py
+++ b/ryu/base/app_manager.py
@@ -115,7 +115,10 @@ class RyuApp(object):
self.observers = {} # ev_cls -> observer-name -> states:set
self.threads = []
self.events = hub.Queue(128)
- self.logger = logging.getLogger(self.name)
+ if hasattr(self.__class__, 'LOGGER_NAME'):
+ self.logger = logging.getLogger(self.__class__.LOGGER_NAME)
+ else:
+ self.logger = logging.getLogger(self.name)
# prevent accidental creation of instances of this class outside RyuApp
class _EventThreadStop(event.EventBase):