summaryrefslogtreecommitdiff
path: root/replay.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2020-10-21 23:08:50 +0100
committerLuke Bratch <luke@bratch.co.uk>2020-10-21 23:08:50 +0100
commitb09cbe8b3575ec018f7d73a0bcd751dba011fc72 (patch)
treef30b2774abd5f22539b200629350204111a41974 /replay.c
parent6737c2ec911afd4a62d2961432ea8c784885e641 (diff)
Improve debug output in readreplayline().
Diffstat (limited to 'replay.c')
-rw-r--r--replay.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/replay.c b/replay.c
index 11c75bc..d09bd8d 100644
--- a/replay.c
+++ b/replay.c
@@ -230,7 +230,7 @@ int readreplayline(int seconds, int linenum, char *str, struct settings *setting
// Build path
if (!snprintf(filename, PATH_MAX, "%s/replay.log", settings->basedir)) {
- debugprint(DEBUG_CRIT, "debuglog(): Error while preparing replay path, exiting!\n");
+ debugprint(DEBUG_CRIT, "readreplayline(): error: couldn't prepare replay path, exiting!\n");
exit(1);
}
@@ -239,7 +239,7 @@ int readreplayline(int seconds, int linenum, char *str, struct settings *setting
fp = fopen(filename, "r");
if (fp == NULL) {
- debugprint(DEBUG_CRIT, "error: readreplayline(): could not open replay log '%s'.\n", filename);
+ debugprint(DEBUG_CRIT, "readreplayline(): could not open replay log '%s'.\n", filename);
return 0;
}
@@ -250,7 +250,7 @@ int readreplayline(int seconds, int linenum, char *str, struct settings *setting
// Read the timestamp from each line
int timestamp = gettimestamp(line);
if (timestamp < 1) {
- debugprint(DEBUG_CRIT, "readreplayline(): Error reading timestamp from replay log file.\n");
+ debugprint(DEBUG_CRIT, "readreplayline(): error: reading timestamp from replay log file.\n");
fclose(fp);
return 0;
}
@@ -282,6 +282,7 @@ int readreplayline(int seconds, int linenum, char *str, struct settings *setting
}
// If we got here something went wrong
+ debugprint(DEBUG_CRIT, "readreplayline(): error: reached the end of function (seconds %d, linenum %d)\n", seconds, linenum);
fclose(fp);
return 0;
}