|
FlatImage
A configurable Linux containerization system
|
Classes | |
| class | Logger |
Functions | |
| void | fork_handler_child () |
| Fork handler that resets the logger in child processes. | |
Variables | |
| thread_local Logger | logger |
| Thread-local logger instance. | |
| void ns_log::anonymous_namespace{log.hpp}::fork_handler_child | ( | ) |
Fork handler that resets the logger in child processes.
This function is registered via pthread_atfork() and automatically executes in child processes after fork(). It resets the logger to a fresh state with /dev/null sink, preventing file descriptor sharing issues.
NOTE: m_pid is intentionally NOT updated here. This allows child processes to detect they are forks (getpid() != m_pid) and log their PID instead of file location.
Definition at line 218 of file log.hpp.