Improved logging format.

This commit is contained in:
Jakob Friedl
2025-08-21 15:08:52 +02:00
parent f69adc53a2
commit c9df7aba64
18 changed files with 91 additions and 115 deletions

View File

@@ -1,7 +1,7 @@
import system, terminal, tiny_sqlite, times, sequtils
import ../utils
import ../../common/[types, utils]
import ../../common/types
#[
Agent database functions - Updated with session key support (no jitter)
@@ -21,7 +21,7 @@ proc dbStoreAgent*(cq: Conquest, agent: Agent): bool =
conquestDb.close()
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return false
return true
@@ -65,7 +65,7 @@ proc dbGetAllAgents*(cq: Conquest): seq[Agent] =
conquestDb.close()
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return agents
@@ -107,7 +107,7 @@ proc dbGetAllAgentsByListener*(cq: Conquest, listenerName: string): seq[Agent] =
conquestDb.close()
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return agents
@@ -119,7 +119,7 @@ proc dbDeleteAgentByName*(cq: Conquest, name: string): bool =
conquestDb.close()
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return false
return true
@@ -134,7 +134,7 @@ proc dbAgentExists*(cq: Conquest, agentName: string): bool =
return res.isSome
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return false
proc dbUpdateCheckin*(cq: Conquest, agentName: string, timestamp: string): bool =
@@ -146,7 +146,7 @@ proc dbUpdateCheckin*(cq: Conquest, agentName: string, timestamp: string): bool
conquestDb.close()
return true
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return false
proc dbUpdateSleep*(cq: Conquest, agentName: string, delay: int): bool =
@@ -158,5 +158,5 @@ proc dbUpdateSleep*(cq: Conquest, agentName: string, delay: int): bool =
conquestDb.close()
return true
except:
cq.writeLine(fgRed, styleBright, "[-] ", getCurrentExceptionMsg())
cq.writeLine(fgRed, styleBright, "[ - ] ", getCurrentExceptionMsg())
return false