Skip to content

Commit

Permalink
please for the love of god do not merge on live
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Jun 10, 2024
1 parent 815aa0e commit 7595134
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 3 additions & 7 deletions monkestation/code/modules/metrics/loki_integration/subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,17 @@ SUBSYSTEM_DEF(loki)


/datum/controller/subsystem/loki/proc/send_user_log(category, message, severity, source, target)
var/list/built = list()
var/time = rustg_unix_timestamp()
time = replacetext(time, ".", "")
time += "000"
built["streams"] = list()
built["streams"]["stream"] = list("target" = "[target]", "source" = "[source]", "category" = "[category]", "level" = "[severity]")
built["streams"]["values"] = list("[time]", message)

push_data(built)
var/built_json = "{\"streams\":\[{\"stream\":{\"level\":\"[severity]\",\"target\":\"[target]\",\"source\":\"[source]\",\"category\":\"[category]\"},\"values\":\[\[\"[time]\", \"[message]\"\]\]}\]}"
push_data(built_json)

/datum/controller/subsystem/loki/proc/push_data(json)
if(!json || !CONFIG_GET(flag/loki_enabled))
message_admins("NOT ABLE TO SEND")
return
var/payload = json_encode(json)
var/payload = json
message_admins(payload)
var/list/headers = list()
headers["Content-Type"] = "application/json"
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6595,6 +6595,7 @@
#include "monkestation\code\modules\mentor\mentor_who.dm"
#include "monkestation\code\modules\meteors\meteor_dark_matteor.dm"
#include "monkestation\code\modules\metrics\metric_subsystem.dm"
#include "monkestation\code\modules\metrics\loki_integration\subsystem.dm"
#include "monkestation\code\modules\metrics\subsystem_analytics\generics.dm"
#include "monkestation\code\modules\microfusion\code\cargo_stuff.dm"
#include "monkestation\code\modules\microfusion\code\gun_types.dm"
Expand Down

0 comments on commit 7595134

Please sign in to comment.