11 #ifndef logger_logFileRaw_hpp    12 #define logger_logFileRaw_hpp    20 #include <mx/ioutils/stringUtils.hpp>    22 #include "../common/defaults.hpp"    84    int logPath( 
const std::string & newPath  );
    98    int logName( 
const std::string & newName  );
   112    int logExt( 
const std::string & newExt  );
   249    size_t nwr = fwrite( data.get(), 
sizeof(char), N, 
m_fout);
   251    if(nwr != N*
sizeof(
char))
   253       std::cerr << 
"logFileRaw::writeLog: Error by fwrite.  At: " << __FILE__ << 
" " << __LINE__ << 
"\n";
   254       std::cerr << 
"logFileRaw::writeLog: errno says: " << strerror(errno) << 
"\n";
   292    m_fout = fopen(fname.c_str(), 
"wb");
   296       std::cerr << 
"logFileRaw::createFile: Error by fopen. At: " << __FILE__ << 
" " << __LINE__ << 
"\n";
   297       std::cerr << 
"logFileRaw::createFile: errno says: " << strerror(errno) << 
"\n";
   298       std::cerr << 
"logFileRaw::createFile: fname = " << fname << 
"\n";
   311 #endif //logger_logFileRaw_hpp size_t maxLogSize()
Get the maximum file size. 
 
#define MAGAOX_default_max_logSize
The default maximum log file size. 
 
size_t m_maxLogSize
The maximum file size in bytes. Default is 10 MB. 
 
int timeStamp(std::string &tstamp)
Get the filename timestamp for this timespecX. 
 
int writeLog(flatlogs::bufferPtrT &data)
Write a log entry to the file. 
 
std::string logName()
Get the name. 
 
std::string m_logName
The base name for the log files. 
 
int close()
Close the file pointer. 
 
std::string logPath()
Get the path. 
 
A class to manage raw binary log files. 
 
static size_t totalSize(bufferPtrT &logBuffer)
Get the total size of the log entry, including the message buffer. 
 
std::string m_logPath
The base path for the log files. 
 
size_t m_currFileSize
The current file size. 
 
#define MAGAOX_default_logExt
The extension for MagAO-X binary log files. 
 
int createFile(flatlogs::timespecX &ts)
Create a new file. 
 
static timespecX timespec(bufferPtrT &logBuffer)
Extract the timespec of a log entry. 
 
logFileRaw()
Default constructor. 
 
std::string logExt()
Get the log extension. 
 
std::shared_ptr< char > bufferPtrT
The log entry buffer smart pointer. 
 
std::string m_logExt
The extension for the log files. 
 
int flush()
Flush the stream. 
 
Flatlogs single include file. 
 
FILE * m_fout
The file pointer. 
 
A fixed-width timespec structure.