Original Post
Hey i am needed to create a logging systemthat logs what ever the engine does into a file. are there any existing logging systems that can do this or any tutorials on how to create them?
void Log(char Log[]){ ofstream out; out.open( _LOG_ , ios_base::app); out << endl << Log; out.close();}
#ifndef LOGGER_H#define LOGGER_H#include "../Glee/GLee.h"class Logger{ public: static void writeFatalErrorLog(const char* format,...); static bool writeErrorLog(const char* format,...); static void writeLog(const char* format,...);};#endif#include "Logger.h"void Logger::writeLog(const char* format,...){ ofstream logFile("Log.txt", ios::app); char stringBuffer[256]; va_list arguments; va_start(arguments, format); vsprintf(stringBuffer, format, arguments); va_end(arguments); logFile << stringBuffer; logFile.close();}bool Logger::writeErrorLog(const char* format,...){ ofstream logFile("Log.txt", ios::app); char stringBuffer[256]; va_list arguments; va_start(arguments, format); vsprintf(stringBuffer, format, arguments); va_end(arguments); logFile << stringBuffer; logFile.close(); return false;}void Logger::writeFatalErrorLog(const char* format,...){ char stringBuffer[256]; ofstream logFile("Log.txt", ios::app); va_list arguments; va_start(arguments, format); vsprintf(stringBuffer, format, arguments); va_end(arguments); logFile << stringBuffer; logFile << endl; logFile.close(); exit(1);}Quote:
Original post by JavaCoolDude
....
Quote:
Original post by JavaCoolDude
*** Source Snippet Removed ***
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more