GnuCash  5.6-150-g038405b370+
Public Member Functions
Logger Class Reference

messages for later display to the user. More...

Public Member Functions

void info (const char *message)
 
void warn (const char *message)
 
void error (const char *message)
 
void clear ()
 
bool has_errors ()
 
bool has_warnings ()
 
void write_log (std::stringstream &stream, LogMsgType type)
 
void infos (std::stringstream &stream)
 
void warnings (std::stringstream &stream)
 
void errors (std::stringstream &stream)
 
std::string report ()
 Compose all of the logged messages into a bullet list, errors first, then warnings, infos last. More...
 

Detailed Description

messages for later display to the user.

Proveds 3 categories: error, warning, and info.

Functions are simple accessors and setters unless noted.

Definition at line 449 of file assistant-stock-transaction.cpp.

Member Function Documentation

◆ report()

std::string Logger::report ( )

Compose all of the logged messages into a bullet list, errors first, then warnings, infos last.

Returns
std::string containing the messages.

Definition at line 498 of file assistant-stock-transaction.cpp.

499 {
500  std::stringstream summary;
501  if (!has_errors())
502  {
503  summary << _("No errors found. Click Apply to create transaction.");
504  infos(summary);
505  }
506  else
507  {
508  summary << _("The following errors must be fixed:");
509  errors(summary);
510  }
511  if (has_warnings())
512  {
513  summary << "\n\n" << _("The following warnings exist:");
514  warnings(summary);
515  }
516  return summary.str();
517 }

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