Skip to content

Instantly share code, notes, and snippets.

/logging.inline.hpp Secret

Created Jun 6, 2013
What would you like to do?
// Example logging class
#include <stdio.h>
class Logger {
static FILE* _log_file;
// open the log file on first call
static void log(const char* msg) {
if (!_log_file) {
// if Logger::log is called from ostream.cpp, _log_file will be a 64 bit FILE*
// otherwise it will be a 32 bit FILE*
_log_file = fopen("out.log","w")
fprintf(msg, "%s", msg);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.