Update sqlmapapi.py

This commit is contained in:
FatihUYSAL 2025-03-24 15:04:04 -04:00 committed by GitHub
parent 9cb317f7f1
commit 74300e4b89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,11 +14,14 @@ import warnings
logging.basicConfig( logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s', # Log format format='%(asctime)s - %(levelname)s - %(message)s', # Log format
level=logging.DEBUG, # Set log level to DEBUG level=logging.DEBUG, # Set log level to DEBUG
handlers=[logging.StreamHandler()] # Print logs to console handlers=[
logging.StreamHandler(), # Print logs to console
logging.FileHandler("app.log") # Log to a file as well
]
) )
# Logger object # Using the logger from lib.core.data
logger = logging.getLogger(__name__) from lib.core.data import logger # Use the logger defined in the original code
sys.dont_write_bytecode = True sys.dont_write_bytecode = True
@ -72,7 +75,6 @@ finally:
from lib.core.common import getUnicode from lib.core.common import getUnicode
from lib.core.common import setPaths from lib.core.common import setPaths
from lib.core.data import logger
from lib.core.patch import dirtyPatches from lib.core.patch import dirtyPatches
from lib.core.patch import resolveCrossReferences from lib.core.patch import resolveCrossReferences
from lib.core.settings import RESTAPI_DEFAULT_ADAPTER from lib.core.settings import RESTAPI_DEFAULT_ADAPTER
@ -114,7 +116,6 @@ def main():
apiparser.add_argument("--password", help="Basic authentication password (optional)") apiparser.add_argument("--password", help="Basic authentication password (optional)")
(args, _) = apiparser.parse_known_args() if hasattr(apiparser, "parse_known_args") else apiparser.parse_args() (args, _) = apiparser.parse_known_args() if hasattr(apiparser, "parse_known_args") else apiparser.parse_args()
# Start the client or the server # Start the client or the server
if args.server: if args.server:
server(args.host, args.port, adapter=args.adapter, username=args.username, password=args.password, database=args.database) server(args.host, args.port, adapter=args.adapter, username=args.username, password=args.password, database=args.database)