improve logger

This commit is contained in:
ziirish 2015-10-19 21:08:13 +02:00
parent c3b4507a27
commit 8f841f3e14
10 changed files with 3 additions and 9 deletions

View file

@ -1 +0,0 @@
bin/bui-agent

View file

@ -1 +0,0 @@
bin/burp-ui

View file

@ -11,7 +11,7 @@ import traceback
from threading import Thread
from logging import Formatter, StreamHandler
from logging.handlers import RotatingFileHandler
from burpui.misc.utils import BUIlogging
from .misc.utils import BUIlogging
try:
import ujson as json
except ImportError:
@ -48,7 +48,6 @@ class BUIAgent(BUIlogging, Dummy):
global g_port, g_bind, g_ssl, g_version, g_sslcert, g_sslkey, g_password
self.conf = conf
self.dbg = debug
self.logger = None
self.padding = 1
if debug > logging.NOTSET:
levels = [0, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]

View file

@ -107,7 +107,6 @@ class Burp(BUIbackend):
if dummy:
return
self.app = None
self.logger = None
self.acl_handler = False
if server:
if hasattr(server, 'app'):

View file

@ -60,7 +60,6 @@ class Burp(Burp1):
global g_burpbin, g_stripbin, g_burpconfcli, g_burpconfsrv, g_tmpdir, BURP_MINIMAL_VERSION
self.proc = None
self.app = None
self.logger = None
self.acl_handler = False
if server:
if hasattr(server, 'app'):

View file

@ -43,7 +43,6 @@ class Burp(BUIbackend):
def __init__(self, server=None, conf=None):
self.app = None
self.logger = None
self.acl_handler = False
if server:
if hasattr(server, 'app'):

View file

@ -26,7 +26,6 @@ class BUIparser(BUIlogging):
"""
self.app = app
self.conf = conf
self.logger = None
if self.app:
self.logger = self.app.logger

View file

@ -125,12 +125,13 @@ else:
class BUIlogging(object):
logger = None
monkey = None
padding = 0
"""Provides a generic logging method for all modules"""
def _logger(self, level, msg, *args):
"""generic logging method so that the logging is backend-independent"""
if self.logger:
if self.logger and self.logger.getEffectiveLevel() >= logging.getLevelName(level.upper()):
sav = None
if not self.monkey:
self.monkey = BUIlogger(__name__)