summaryrefslogtreecommitdiffstats
path: root/Examples/OldMain/Utils/Logger.cpp
diff options
context:
space:
mode:
authorKonstantin <const@const.me>2023-01-16 16:27:52 +0100
committerKonstantin <const@const.me>2023-01-16 16:27:52 +0100
commit012be51811bec6614ad9fbc5e74a449e803267c6 (patch)
treefb557ee8630c8fc37828c10046ef8ace70f79f33 /Examples/OldMain/Utils/Logger.cpp
parentbb64452c1e1ad0a6860d6e24c3a502ccef9b366f (diff)
Fixed the old sample project
Diffstat (limited to 'Examples/OldMain/Utils/Logger.cpp')
-rw-r--r--Examples/OldMain/Utils/Logger.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/Examples/OldMain/Utils/Logger.cpp b/Examples/OldMain/Utils/Logger.cpp
new file mode 100644
index 0000000..b9217e7
--- /dev/null
+++ b/Examples/OldMain/Utils/Logger.cpp
@@ -0,0 +1,40 @@
+#include <stdint.h>
+#include <vector>
+#include <cstdarg>
+#include "Logger.h"
+
+namespace
+{
+ void logMessage( const char* lvl, const char8_t* pszFormat, std::va_list va )
+ {
+ fprintf( stderr, "%s: ", lvl );
+ vfprintf( stderr, (const char*)pszFormat, va );
+ fprintf( stderr, "\n" );
+ }
+}
+
+#define LOG_MESSAGE_IMPL( lvl ) \
+ std::va_list args; \
+ va_start( args, pszFormat ); \
+ logMessage( lvl, pszFormat, args ); \
+ va_end( args );
+
+void logError( const char8_t* pszFormat, ... )
+{
+ LOG_MESSAGE_IMPL( "Error" );
+}
+
+void logWarning( const char8_t* pszFormat, ... )
+{
+ LOG_MESSAGE_IMPL( "Warning" );
+}
+
+void logInfo( const char8_t* pszFormat, ... )
+{
+ LOG_MESSAGE_IMPL( "Info" );
+}
+
+void logDebug( const char8_t* pszFormat, ... )
+{
+ LOG_MESSAGE_IMPL( "Debug" );
+} \ No newline at end of file