Implemented initial version of logging system. Log formatting and content needs to be reworked.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import times, strformat, terminal, tables, sequtils, strutils
|
||||
|
||||
import ./logger
|
||||
import ../utils
|
||||
import ../protocol/parser
|
||||
import ../../modules/manager
|
||||
@@ -56,6 +57,7 @@ proc handleAgentCommand*(cq: Conquest, input: string) =
|
||||
|
||||
let date: string = now().format("dd-MM-yyyy HH:mm:ss")
|
||||
cq.writeLine(fgBlue, styleBright, fmt"[{date}] ", fgYellow, fmt"[{cq.interactAgent.agentId}] ", resetStyle, styleBright, input)
|
||||
cq.log(fmt"Agent command received: {input}")
|
||||
|
||||
# Convert user input into sequence of string arguments
|
||||
let parsedArgs = parseInput(input)
|
||||
@@ -78,8 +80,8 @@ proc handleAgentCommand*(cq: Conquest, input: string) =
|
||||
|
||||
# Add task to queue
|
||||
cq.interactAgent.tasks.add(task)
|
||||
cq.writeLine(fgBlack, styleBright, fmt"[{date}] [*] ", resetStyle, fmt"Tasked agent to {command.description.toLowerAscii()}")
|
||||
cq.info(fgBlack, styleBright, fmt"[{date}] [*] ", resetStyle, fmt"Tasked agent to {command.description.toLowerAscii()}")
|
||||
|
||||
except CatchableError:
|
||||
cq.writeLine(fgRed, styleBright, fmt"[-] {getCurrentExceptionMsg()}" & "\n")
|
||||
cq.error(getCurrentExceptionMsg() & "\n")
|
||||
return
|
||||
Reference in New Issue
Block a user