MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / setRestAPILog

Function setRestAPILog

lib/utils/api.py:281–292  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

279 conf.databaseCursor.execute("INSERT INTO logs VALUES(NULL, ?, ?, ?, ?)", (conf.taskid, time.strftime("%X"), record.levelname, str(record.msg % record.args if record.args else record.msg)))
280
281def setRestAPILog():
282 if conf.api:
283 try:
284 conf.databaseCursor = Database(conf.database)
285 conf.databaseCursor.connect("client")
286 except sqlite3.OperationalError as ex:
287 raise SqlmapConnectionException("%s ('%s')" % (ex, conf.database))
288
289 # Set a logging handler that writes log messages to a IPC database
290 logger.removeHandler(LOGGER_HANDLER)
291 LOGGER_RECORDER = LogRecorder()
292 logger.addHandler(LOGGER_RECORDER)
293
294# Generic functions
295def is_admin(token):

Callers 1

mainFunction · 0.90

Calls 4

DatabaseClass · 0.85
LogRecorderClass · 0.85
connectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…