Skip to content
Snippets Groups Projects
Commit 3d1e05e5 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Log the current Git branch and hash along with every error

This eliminates any ambiguity about what exact version was in use when each error is logged.
parent ed3fb8cc
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -20,6 +20,8 @@
****************************************************************************/
#include "sbbs.h"
#include "git_branch.h"
#include "git_hash.h"
const char* log_line_ending = "\r\n";
......@@ -113,8 +115,10 @@ extern "C" int errorlog(scfg_t* cfg, int level, const char* host, const char* te
SAFEPRINTF(path, "%serror.log", cfg->logs_dir);
if((fp = fnopen(NULL,path,O_WRONLY|O_CREAT|O_APPEND))==NULL)
return -1;
fprintf(fp,"%.24s %s%s%s%s%s"
fprintf(fp,"%.24s %s/%s %s%s%s%s%s"
,ctime_r(&now, buf)
,GIT_BRANCH
,GIT_HASH
,host==NULL ? "":host
,log_line_ending
,text
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment