I\'m creating my own logging utility for my project, I want to create a function like iostream\'s std::cout, to log to a file and print to the console as well.
Here\
I will not enter coding details here, but I will provide you some quick guidelines :
Create a singleton object pool (for loggers is ok to create a singleton) or a namespace or a that returns a certain log class according to the enum :
Logger& SingletonLoggersManager::GetLoggerForLevel(eLogLevel);
Override the "<<" operator for your class in order to allow outputting accoridng to your needs in your Logger class
https://msdn.microsoft.com/en-us/library/1z2f6c2k.aspx
Define a macro in order to be able to make a quick call inside your code :
#define LOG(x) SingletonLogger::GetLoggerForLevel(eLogLoevel);
Now when you use inside your code
Log(debug) << "test"
It will expand to :
(SingletonLogger::GetLoogerForLevel(debug)) << "test";