def add_logging_level(name, value, method_name=None):
if not method_name:<EOL><INDENT>method_name = name.lower()<EOL><DEDENT>logging.addLevelName(value, name)<EOL>setattr(logging, name, value)<EOL>level_map[name.lower()] = value<EOL>if value == getattr(logging, '<STR_LIT>', None):  <EOL><INDENT>def logForLevel(self, message='<STR_LIT>', *args, **kwargs):<EOL><INDENT>if self.isEnabledFor(value):<EOL><INDENT>message = (message + '<STR_LIT>').lstrip() + traceback.format_exc()<EOL>self._log(value, message, args, **kwargs)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>def logForLevel(self, message, *args, **kwargs):<EOL><INDENT>if self.isEnabledFor(value):<EOL><INDENT>self._log(value, message, args, **kwargs)<EOL><DEDENT><DEDENT><DEDENT>def logToRoot(message, *args, **kwargs):  <EOL><INDENT>logging.log(value, message, *args, **kwargs)<EOL><DEDENT>setattr(logging.getLoggerClass(), method_name, logForLevel)<EOL>setattr(logging, method_name, logToRoot)<EOL>
Comprehensively adds a new logging level to the ``logging`` module and
        the currently configured logging class.

        Derived from: https://stackoverflow.com/a/35804945/450917