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 452 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 501 of file assistant-stock-transaction.cpp.

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

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