"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.

This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.


constants
"""

import logging

def set_logging(name="dock", level=logging.DEBUG):
    # create logger
    logger = logging.getLogger(name)
    logger.handlers = []
    logger.setLevel(level)

    # create console handler and set level to debug
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)

    # create formatter
    formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

    # add formatter to ch
    ch.setFormatter(formatter)

    # add ch to logger
    logger.addHandler(ch)


set_logging(level=logging.WARNING)  # override this however you want
@@ -248,16 +248,30 @@
 ng.DEBUG
+, handler=None
 ):%0A    #
@@ -375,16 +375,40 @@
 level)%0A%0A
+    if not handler:%0A    
     # cr
@@ -455,18 +455,27 @@
 bug%0A    
-ch
+    handler
  = loggi
@@ -493,26 +493,35 @@
 ndler()%0A    
-ch
+    handler
 .setLevel(lo
@@ -534,24 +534,28 @@
 DEBUG)%0A%0A    
+ 
+   
 # create for
@@ -561,16 +561,20 @@
 rmatter%0A
+    
     form
@@ -656,16 +656,20 @@
 ge)s')%0A%0A
+    
     # ad
@@ -690,18 +690,27 @@
  ch%0A    
-ch
+    handler
 .setForm
@@ -772,18 +772,23 @@
 Handler(
-c
 h
+andler
 )%0A%0A%0Aset_
@@ -851,8 +851,9 @@
 you want
+%0A

Allow redirecting dock's logs to a given handler only