summaryrefslogtreecommitdiff
path: root/replay.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-05-30 21:23:44 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-05-30 21:23:44 +0100
commit6d183c02a50a42743c3031532f458ab5cea0685d (patch)
treed1463e8f53df26ec5f8c3c13a77880d11d3bc57f /replay.c
parentef93f4d61f03faa0edd60f11c7790ad3b67b44d4 (diff)
Convert debugprint() from being to file/screen/disabled to always being to file with configurable verbosity.
Diffstat (limited to 'replay.c')
-rw-r--r--replay.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/replay.c b/replay.c
index 7201082..3c274fa 100644
--- a/replay.c
+++ b/replay.c
@@ -199,7 +199,7 @@ int readreplayline(int seconds, int linenum, char *str, char *basedir) {
fp = fopen(filename, "r");
if (fp == NULL) {
- debugprint("error: could not open replay log '%s'.\n", filename);
+ debugprint(DEBUG_CRIT, "error: could not open replay log '%s'.\n", filename);
fclose(fp);
return 0;
}
@@ -211,7 +211,7 @@ int readreplayline(int seconds, int linenum, char *str, char *basedir) {
// Read the timestamp from each line
int timestamp = gettimestamp(line);
if (timestamp < 1) {
- debugprint("Error reading timestamp from replay log file.\n");
+ debugprint(DEBUG_CRIT, "Error reading timestamp from replay log file.\n");
fclose(fp);
return 0;
}
@@ -257,7 +257,7 @@ int writereplayline(char *str, char *basedir) {
fp = fopen(filename, "a");
if (fp == NULL) {
- debugprint("error: could not open replay log '%s' for writing.\n", filename);
+ debugprint(DEBUG_CRIT, "error: could not open replay log '%s' for writing.\n", filename);
fclose(fp);
return 0;
}
@@ -274,11 +274,11 @@ int writereplayline(char *str, char *basedir) {
// Ensure the line finishes with CRLF
appendcrlf(line);
- debugprint("Complete replay log string to write: '%s', length '%ld'.\n", line, strlen(line));
+ debugprint(DEBUG_FULL, "Complete replay log string to write: '%s', length '%ld'.\n", line, strlen(line));
// Write complete line to file
if ((bytes = fprintf(fp, "%s", line)) < 0) {
- debugprint("error: could not write to replay log file.\n");
+ debugprint(DEBUG_CRIT, "error: could not write to replay log file.\n");
fclose(fp);
return 0;
}