Skip to content

Commit

Permalink
updated reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
nettrino committed Dec 29, 2023
1 parent 69b6464 commit 759c03e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 1 addition & 8 deletions src/config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,8 @@ template getReportTemplate*(): ReportTemplate =
let
outconf = chalkConfig.outputConfigs[getBaseCommandName()]
tmplName = outconf.report_template
actionId = "_ACTION_ID"
let templateRef = chalkConfig.reportTemplates[tmplName]

if actionId in templateRef.keys:
templateRef.keys[actionId].use = true
else:
templateRef.keys[actionId] = KeyConfig(use: true)

templateRef
chalkConfig.reportTemplates[tmplName]

template forceReportKeys*(keynames: openarray[string]) =
let templateRef = getReportTemplate()
Expand Down
2 changes: 2 additions & 0 deletions src/reporting.nim
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ proc doReporting*(topic="report") {.exportc, cdecl.} =
if inSubscan():
let ctx = getCurrentCollectionCtx()
ctx.report = doEmbeddedReport()
forceReportKeys(["_ACTION_ID"])
else:
trace("Collecting runtime host info.")
collectRunTimeHostInfo()
trace("Generating command report.")
let report = doCommandReport()
forceReportKeys(["_ACTION_ID"])
if report != "":
safePublish(topic, report)
doCustomReporting()
Expand Down

0 comments on commit 759c03e

Please sign in to comment.