OpenPFC  0.1.4
Phase Field Crystal simulation framework
Loading...
Searching...
No Matches
logging.hpp File Reference

Minimal structured logging utilities for OpenPFC. More...

#include <iosfwd>
#include <string>
#include <string_view>
Include dependency graph for logging.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pfc::Logger
 Lightweight logger configuration. More...
 

Enumerations

enum class  pfc::LogLevel { Debug = 0 , Info = 1 , Warning = 2 , Error = 3 }
 Log severity levels.
 

Functions

void pfc::log (const Logger &logger, LogLevel level, std::string_view message)
 Write a log message if level >= logger.m_min_level.
 
void pfc::log_error (const Logger &lg, std::string_view msg)
 Convenience helpers.
 
void pfc::log_warning (const Logger &lg, std::string_view msg)
 
void pfc::log_info (const Logger &lg, std::string_view msg)
 
void pfc::log_debug (const Logger &lg, std::string_view msg)
 

Detailed Description

Minimal structured logging utilities for OpenPFC.

Transparent API following OpenPFC philosophy: structs + free functions.

Function Documentation

◆ log()

void pfc::log ( const Logger logger,
LogLevel  level,
std::string_view  message 
)

Write a log message if level >= logger.m_min_level.

Messages at Warning/Error are written to std::cerr, otherwise to std::clog. When m_rank >= 0, messages are prefixed with "rank <N>: ".

Here is the call graph for this function:
Here is the caller graph for this function: