FIMS  v0.8.0
Loading...
Searching...
No Matches
fims::LogEntry Struct Reference

#include <def.hpp>

Public Member Functions

std::string to_string ()
 

Public Attributes

std::string timestamp
 
std::string message
 
std::string level
 
size_t rank
 
std::string user
 
std::string wd
 
std::string file
 
std::string routine
 
int line
 

Detailed Description

Log entry.

Member Function Documentation

◆ to_string()

std::string fims::LogEntry::to_string ( )
inline

Convert this object to a string.

Member Data Documentation

◆ file

std::string fims::LogEntry::file

The full file path of the file that triggered the log entry, e.g., "C:/github/NOAA-FIMS/FIMS/inst/include/interface/rcpp/rcpp_objects/rcpp_selectivity.hpp".

◆ level

std::string fims::LogEntry::level

The logging level, which is a result of which macro was used to generate the message, e.g., FIMS_INFO_LOG(), FIMS_WARNING_LOG(), or FIMS_ERROR_LOG() results in "info", "warning", or "error", respectively, in the log file. An additional level is available to developers from FIMS_DEBUG_LOG(), resulting in a level of "debug", but this macro is only available in branches other than main.

◆ line

int fims::LogEntry::line

The line in file where the log entry was initiated, e.g., "219", which will be a line inside of the routine listed above.

◆ message

std::string fims::LogEntry::message

The description of the log entry, e.g., "Adding Selectivity object to TMB" or "Mismatch dimension error", where the descriptions are predefined in the C++ code. Please make a GitHub issue or contact a developer if you have ideas for a more informative description.

◆ rank

size_t fims::LogEntry::rank

The message id, directly corresponds to the order in which the entries were created, e.g., "1", which is helpful for knowing the order of operations within the code base and comparing log files across model runs.

◆ routine

std::string fims::LogEntry::routine

The function or method that led to the initialization the log entry, e.g., "virtual bool LogisticSelectivityInterface::add_to_fims_tmb()". If the function is templated, then the function type will be reported here in square brackets after the function name, e.g., "bool fims_info::Information<Type>::CreateModel() [with Type = double]".

◆ timestamp

std::string fims::LogEntry::timestamp

The date/time that the log entry was created, e.g., "Oct 28 09:18:51 2024". You can track how long it took to work through each portion of the model by analyzing the progression of the timestamp through the log file.

◆ user

std::string fims::LogEntry::user

The user name registered to the computer where the log file was created, e.g., "John.Doe".

◆ wd

std::string fims::LogEntry::wd

The working directory for the R environment that created the log file, e.g., "C:/github/NOAA-FIMS/FIMS/vignettes" if you are on a Windows machine or "/home/oppy/FIMS-Testing/dev/dev_logging/FIMS/vignettes" if you are on a linux machine.


The documentation for this struct was generated from the following file: