# Path: radical/utils/logger/filehandler.py
# class FileHandler(LFileHandler):
#     """ A output FileHandler. """
#     pass


import re
import logging
import radical.utils         as ru
import radical.utils.config  as ruc
from   radical.utils.logger.colorstreamhandler import *
from   radical.utils.logger.filehandler        import FileHandler
from   radical.utils.logger.defaultformatter   import DefaultFormatter
        if self._loglevel is not None:
            if self._loglevel.isdigit():
                if   int(self._loglevel)    >= 4:           self._loglevel = logging.DEBUG
                elif int(self._loglevel)    == 3:           self._loglevel = logging.INFO
                elif int(self._loglevel)    == 2:           self._loglevel = logging.WARNING
                elif int(self._loglevel)    == 1:           self._loglevel = logging.ERROR
                elif int(self._loglevel)    == 0:           self._loglevel = logging.CRITICAL
                else: raise ValueError ('%s is not a valid value for %s_VERBOSE.' \
                                     % (self._loglevel, self._uc_name))
            else:
                if   self._loglevel.lower() == 'debug':     self._loglevel = logging.DEBUG
                elif self._loglevel.lower() == 'info':      self._loglevel = logging.INFO
                elif self._loglevel.lower() == 'warning':   self._loglevel = logging.WARNING
                elif self._loglevel.lower() == 'error':     self._loglevel = logging.ERROR
                elif self._loglevel.lower() == 'critical':  self._loglevel = logging.CRITICAL
                else: raise ValueError ('%s is not a valid value for %s_VERBOSE.' \
                                     % (self._loglevel, self._uc_name))

        # create the handlers (target + formatter + filter)
        for target in self._targets:

            if target.lower() == 'stdout':
                # create a console stream logger
                # Only enable colour if support was loaded properly
                if has_color_stream_handler is True:
                    handler = ColorStreamHandler()
                else: 
                    handler = logging.StreamHandler()
            else:
                # got to be a file logger

# Path: radical/utils/logger/filehandler.py
# class FileHandler(LFileHandler):
#     """ A output FileHandler. """
#     pass


# Path: radical/utils/logger/logger.py
import re
import logging
import radical.utils         as ru
import radical.utils.config  as ruc
from   radical.utils.logger.colorstreamhandler import *
from   radical.utils.logger.filehandler        import FileHandler
from   radical.utils.logger.defaultformatter   import DefaultFormatter

        if self._loglevel is not None:
            if self._loglevel.isdigit():
                if   int(self._loglevel)    >= 4:           self._loglevel = logging.DEBUG
                elif int(self._loglevel)    == 3:           self._loglevel = logging.INFO
                elif int(self._loglevel)    == 2:           self._loglevel = logging.WARNING
                elif int(self._loglevel)    == 1:           self._loglevel = logging.ERROR
                elif int(self._loglevel)    == 0:           self._loglevel = logging.CRITICAL
                else: raise ValueError ('%s is not a valid value for %s_VERBOSE.' \
                                     % (self._loglevel, self._uc_name))
            else:
                if   self._loglevel.lower() == 'debug':     self._loglevel = logging.DEBUG
                elif self._loglevel.lower() == 'info':      self._loglevel = logging.INFO
                elif self._loglevel.lower() == 'warning':   self._loglevel = logging.WARNING
                elif self._loglevel.lower() == 'error':     self._loglevel = logging.ERROR
                elif self._loglevel.lower() == 'critical':  self._loglevel = logging.CRITICAL
                else: raise ValueError ('%s is not a valid value for %s_VERBOSE.' \
                                     % (self._loglevel, self._uc_name))

        # create the handlers (target + formatter + filter)
        for target in self._targets:

            if target.lower() == 'stdout':
                # create a console stream logger
                # Only enable colour if support was loaded properly
                if has_color_stream_handler is True:
                    handler = ColorStreamHandler()
                else: 
                    handler = logging.StreamHandler()
            else:
                # got to be a file logger

                handler = FileHandler(target)