logging: make swaglog context match in python and c (#31288)

* logging: make swaglog context match in python and c

* add git context to athenad
old-commit-hash: d0a1fa636a9bf2f6137c4a61b27fa29f690864f6
This commit is contained in:
Greg Hogan
2024-02-02 23:10:04 -08:00
committed by GitHub
parent 14e12980f5
commit 94b3f2d22a
3 changed files with 21 additions and 2 deletions
+9
View File
@@ -41,6 +41,15 @@ public:
if (char* dongle_id = getenv("DONGLE_ID")) {
ctx_j["dongle_id"] = dongle_id;
}
if (char* git_origin = getenv("GIT_ORIGIN")) {
ctx_j["origin"] = git_origin;
}
if (char* git_branch = getenv("GIT_BRANCH")) {
ctx_j["branch"] = git_branch;
}
if (char* git_commit = getenv("GIT_COMMIT")) {
ctx_j["commit"] = git_commit;
}
if (char* daemon_name = getenv("MANAGER_DAEMON")) {
ctx_j["daemon"] = daemon_name;
}