aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-02-14 19:27:28 +0100
committerSven Gothel <[email protected]>2021-02-14 19:27:28 +0100
commit1ad0d850655c13943436f725732bbe7c289957d8 (patch)
treeea8656f26366d7676919f92dfeb09e8f45886afc /src
parent287b32c6328fbebeccc902a26c966ab49a5d6be3 (diff)
Add 'fprintf_td(FILE* stream, const char * format, ...) noexcept', fprintf(..) + prepending the environment::getElapsedMillisecond() timestamp
Diffstat (limited to 'src')
-rw-r--r--src/debug.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/debug.cpp b/src/debug.cpp
index 4cc228e..2db91d0 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -185,6 +185,15 @@ void jau::PLAIN_PRINT(const bool printPrefix, const char * format, ...) noexcept
fflush(stderr);
}
+int jau::fprintf_td(FILE* stream, const char * format, ...) noexcept {
+ int res = ::fprintf(stderr, "[%s] ", jau::to_decstring(environment::getElapsedMillisecond(), ',', 9).c_str());
+ va_list args;
+ va_start (args, format);
+ res += ::vfprintf(stream, format, args);
+ va_end (args);
+ return res;
+}
+
void jau::COND_PRINT_impl(const char * format, ...) noexcept {
fprintf(stderr, "[%s] ", jau::to_decstring(environment::getElapsedMillisecond(), ',', 9).c_str());
va_list args;