66# include <sys/utsname.h>
225# define WRITE_IN_LOG(log, format...) log.write_line(__FILE__, __LINE__, format)
227# define WRITE_IN_LOG(log, format...) log.write_line(format)
Thread-safe log manager with timestamps.
size_t num_lines
Lines written (not used)
char print_buffer[Max_Log_Line_Length]
Message buffer.
void get_time()
Get current time as formatted string.
~Log_Manager()
Destructor releases mutex.
static const short int Max_Time_Line_Length
Max timestamp length.
void init_line(const char *format,...)
Write log line without newline (for multi-part messages).
void write_line(const char *format,...)
Write complete log line with newline.
static const short int Max_Log_Line_Length
Max message length.
pthread_mutex_t mutex
Thread synchronization mutex.
char time_buffer[Max_Time_Line_Length]
Timestamp buffer.
size_t max_num_lines
Max lines (not used)
FILE * file_descriptor
Output file descriptor.
Log_Manager(FILE *_file_descriptor)
Construct log manager for a file.
DynList< T > maps(const C &c, Op op)
Classic map operation.
void init_mutex(pthread_mutex_t *m)
Initialize a pthread mutex (pointer version)
void destroy_mutex(pthread_mutex_t *m)
Destroy a pthread mutex (pointer version)
RAII-style wrapper for POSIX mutexes.
#define CRITICAL_SECTION(mutex)
Create an anonymous critical section guard.