work in progress
This commit is contained in:
22
designer/src/log.h
Normal file
22
designer/src/log.h
Normal file
@@ -0,0 +1,22 @@
|
||||
// Logging utility for Mosis Designer
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
namespace mosis {
|
||||
|
||||
// Global log file - defined in main.cpp
|
||||
extern std::ofstream* g_log_file_ptr;
|
||||
|
||||
// Log function that writes to both stdout and file
|
||||
inline void Log(const std::string& message) {
|
||||
std::cout << message << std::endl;
|
||||
if (g_log_file_ptr && g_log_file_ptr->is_open()) {
|
||||
*g_log_file_ptr << message << std::endl;
|
||||
g_log_file_ptr->flush();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mosis
|
||||
Reference in New Issue
Block a user