libsheepy

C lib for handling text files, strings and json like data structure with an object oriented system
git clone https://spartatek.se/git/libsheepy.git
Log | Files | Refs | README | LICENSE

commit 478f32c99081c72e2d4861ce8b9a23fd1757a218
parent b62563e31283ef0cc1bf2d7315c8255560d15338
Author: Remy Noulin <loader2x@gmail.com>
Date:   Thu, 25 Aug 2022 14:47:50 +0200

add pipe on each line when log mode is verbose

release/libsheepy.c | 4 +++-
src/libsheepy.c     | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)

Diffstat:
Mrelease/libsheepy.c | 4+++-
Msrc/libsheepy.c | 4+++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/release/libsheepy.c b/release/libsheepy.c @@ -1332,10 +1332,12 @@ void _pLog(int loglevel, const char *file, const char *func, int line, const cha /* logVar(_log_current_mode, "d"); */ /* puts(log_tags[_log_current_mode][loglevel]); */ + char *linePrefix = ""; switch(_log_current_mode) { case LOG_VERBOSE: for (i=firstLogFile; i < _current_log_file; i++) { fprintf(_logging_files[i], "%s %s() (%s:%d) at %s |\t", progName ? progName : defaultProgName, func, file, line, clock); + linePrefix = " |\t";; } break; case LOG_FUNC: @@ -1385,7 +1387,7 @@ void _pLog(int loglevel, const char *file, const char *func, int line, const cha toLog = strtok(NULL, "\n"); while (toLog) { for (i=firstLogFile; i < _current_log_file; i++) { - fprintf(_logging_files[i], "%s\n", toLog); + fprintf(_logging_files[i], "%s%s\n", linePrefix, toLog); } toLog = strtok(NULL, "\n"); } diff --git a/src/libsheepy.c b/src/libsheepy.c @@ -1388,10 +1388,12 @@ void _pLog(int loglevel, const char *file, const char *func, int line, const cha /* logVar(_log_current_mode, "d"); */ /* puts(log_tags[_log_current_mode][loglevel]); */ + char *linePrefix = ""; switch(_log_current_mode) { case LOG_VERBOSE: for (i=firstLogFile; i < _current_log_file; i++) { fprintf(_logging_files[i], "%s %s() (%s:%d) at %s |\t", progName ? progName : defaultProgName, func, file, line, clock); + linePrefix = " |\t";; } break; case LOG_FUNC: @@ -1441,7 +1443,7 @@ void _pLog(int loglevel, const char *file, const char *func, int line, const cha toLog = strtok(NULL, "\n"); while (toLog) { for (i=firstLogFile; i < _current_log_file; i++) { - fprintf(_logging_files[i], "%s\n", toLog); + fprintf(_logging_files[i], "%s%s\n", linePrefix, toLog); } toLog = strtok(NULL, "\n"); }