def __init__(self, name, level=0): if level == 0: level = option_parser.get_verbose() Logger.__init__(self, name, level) self.formatter = self.format handler = StreamHandler() handler.setFormatter(self.formatter) self.addHandler(handler)
# * If you wish to specify special license conditions of your * # * contributions, just say so when you send them. * # * * # * This program is distributed in the hope that it will be useful, but * # * WITHOUT ANY WARRANTY; without even the implied warranty of * # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Nmap * # * license file for more details (it's in a COPYING file included with * # * Nmap, and also available from https://svn.nmap.org/nmap/COPYING * # * * # ***************************************************************************/ from logging import Logger, StreamHandler, Formatter from zenmapCore.Name import APP_DISPLAY_NAME from zenmapCore.UmitOptionParser import option_parser LOGLEVEL = option_parser.get_verbose() class Log(Logger, object): def __init__(self, name, level=0): Logger.__init__(self, name, level) self.formatter = self.format handler = StreamHandler() handler.setFormatter(self.formatter) self.addHandler(handler) def get_formatter(self): return self.__formatter
# * contributions, just say so when you send them. * # * * # * This program is distributed in the hope that it will be useful, but * # * WITHOUT ANY WARRANTY; without even the implied warranty of * # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Nmap * # * license file for more details (it's in a COPYING file included with * # * Nmap, and also available from https://svn.nmap.org/nmap/COPYING * # * * # ***************************************************************************/ from logging import Logger, StreamHandler, Formatter from zenmapCore.Name import APP_DISPLAY_NAME from zenmapCore.UmitOptionParser import option_parser LOGLEVEL = option_parser.get_verbose() class Log(Logger, object): def __init__(self, name, level=0): Logger.__init__(self, name, level) self.formatter = self.format handler = StreamHandler() handler.setFormatter(self.formatter) self.addHandler(handler) def get_formatter(self): return self.__formatter def set_formatter(self, fmt):