23 lines
513 B
C++
23 lines
513 B
C++
// 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
|