mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-21 06:45:24 -06:00
improve logger
This commit is contained in:
parent
c3b4507a27
commit
8f841f3e14
10 changed files with 3 additions and 9 deletions
|
|
@ -1 +0,0 @@
|
|||
bin/bui-agent
|
||||
|
|
@ -1 +0,0 @@
|
|||
bin/burp-ui
|
||||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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'):
|
||||
|
|
|
|||
|
|
@ -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'):
|
||||
|
|
|
|||
|
|
@ -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'):
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ class BUIparser(BUIlogging):
|
|||
"""
|
||||
self.app = app
|
||||
self.conf = conf
|
||||
self.logger = None
|
||||
if self.app:
|
||||
self.logger = self.app.logger
|
||||
|
||||
|
|
|
|||
|
|
@ -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__)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue