WarpX
Functions
ablastr::utils::TextMsg Namespace Reference

Functions

std::string Err (const std::string &msg, bool do_text_wrapping=true)
 This function formats a text message as an error message, adding the '### ERROR: ' prefix and (by default) performing text wrapping. More...
 
std::string Info (const std::string &msg, bool do_text_wrapping=true)
 This function formats a text message as an info message, adding the '### INFO: ' prefix and (by default) performing text wrapping. More...
 
std::string Warn (const std::string &msg, bool do_text_wrapping=true)
 This function formats a text message as a warning message, adding the '### WARN: ' prefix and (by default) performing text wrapping. Warning: this format is not used by the WarningLogger, which has an internal, dedicated, formatter. More...
 
void Assert (const char *ex, const char *file, int line, const std::string &msg)
 This function is a wrapper around amrex::Assert, designed to ensure the uniform formatting of the error messages. The function is designed to be used via the ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE(EX,MSG) macro. More...
 
void Abort (const char *file, int line, const std::string &msg)
 This function is a wrapper around amrex::Abort, designed to ensure the uniform formatting of the error messages. The function is designed to be used via the ABLASTR_ABORT_WITH_MESSAGE(MSG) macro. More...
 

Function Documentation

◆ Abort()

void ablastr::utils::TextMsg::Abort ( const char *  file,
int  line,
const std::string &  msg 
)

This function is a wrapper around amrex::Abort, designed to ensure the uniform formatting of the error messages. The function is designed to be used via the ABLASTR_ABORT_WITH_MESSAGE(MSG) macro.

Parameters
[in]filethe file where abort was called
[in]linethe line here abort was called
[in]msgthe error message

◆ Assert()

void ablastr::utils::TextMsg::Assert ( const char *  ex,
const char *  file,
int  line,
const std::string &  msg 
)

This function is a wrapper around amrex::Assert, designed to ensure the uniform formatting of the error messages. The function is designed to be used via the ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE(EX,MSG) macro.

Parameters
[in]exthe text of the failed assertion
[in]filethe file where the assertion failed
[in]linethe line where the assertion failed
[in]msgthe error message

◆ Err()

std::string ablastr::utils::TextMsg::Err ( const std::string &  msg,
bool  do_text_wrapping = true 
)

This function formats a text message as an error message, adding the '### ERROR: ' prefix and (by default) performing text wrapping.

Parameters
[in]msgthe string to be formatted
[in]do_text_wrappingif true, the text of the message is automatically wrapped
Returns
the formatted message

◆ Info()

std::string ablastr::utils::TextMsg::Info ( const std::string &  msg,
bool  do_text_wrapping = true 
)

This function formats a text message as an info message, adding the '### INFO: ' prefix and (by default) performing text wrapping.

Parameters
[in]msgthe string to be formatted
[in]do_text_wrappingif true, the text of the message is automatically wrapped
Returns
the formatted message

◆ Warn()

std::string ablastr::utils::TextMsg::Warn ( const std::string &  msg,
bool  do_text_wrapping = true 
)

This function formats a text message as a warning message, adding the '### WARN: ' prefix and (by default) performing text wrapping. Warning: this format is not used by the WarningLogger, which has an internal, dedicated, formatter.

Parameters
[in]msgthe string to be formatted
[in]do_text_wrappingif true, the text of the message is automatically wrapped
Returns
the formatted message