CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <Log.hh>
Public Member Functions | |
Log (std::ostream &_ostream=std::cout, int _verbosity=standard, bool _show_clock=false, int _indent_space=2) | |
Construct a Log. More... | |
template<int _required_verbosity = standard> | |
void | calculate (const std::string &what) |
template<int _required_verbosity = standard> | |
void | construct (const std::string &what) |
template<int _required_verbosity = standard> | |
void | generate (const std::string &what) |
template<int _required_verbosity = standard> | |
void | set (const std::string &what) |
template<int _required_verbosity = standard> | |
void | check (const std::string &what) |
template<int _required_verbosity = standard> | |
void | results (const std::string &what) |
template<int _required_verbosity = standard> | |
void | read (const std::string &what) |
template<int _required_verbosity = standard> | |
void | write (const std::string &what) |
template<int _required_verbosity = standard> | |
void | begin (const std::string &what) |
template<int _required_verbosity = standard> | |
void | end (const std::string &what) |
template<int _required_verbosity = standard> | |
void | warning (const std::string &what) |
template<int _required_verbosity = standard> | |
void | error (const std::string &what) |
template<int _required_verbosity = standard> | |
void | compiling (const std::string &what) |
template<int _required_verbosity = standard> | |
void | custom (const std::string &what) |
template<int _required_verbosity = standard> | |
void | custom (const std::string &type, const std::string &what) |
template<int _required_verbosity = standard> | |
void | begin_section () |
Begin a section, without header. More... | |
Log & | subsection () |
Create a subsection. More... | |
void | end_section () |
End a section. More... | |
void | restart_clock () |
void | show_clock () |
void | hide_clock () |
double | time_s () const |
void | begin_lap () |
double | lap_time () const |
int | verbosity () const |
void | set_verbosity (int _verbosity) |
template<int _required_verbosity> | |
Log & | require () |
void | reset (std::ostream &_ostream=std::cout) |
void | set_width (int width) |
int | width () const |
void | set_justification (JustificationType justification) |
JustificationType | justification () |
Log & | paragraph (std::string text) |
Print indented paragraph with wrapping at Log::width() More... | |
Log & | verbatim (std::string text, bool indent_first_line=true) |
Print verbatim, but with indentation (optional on first line) More... | |
template<typename OutputIterator > | |
Log & | verbatim_list (OutputIterator begin, OutputIterator end, std::string sep="- ") |
Print a list. More... | |
operator std::ostream & () | |
std::ostream & | ostream () |
bool | print () const |
operator bool () | |
int | indent_space () const |
std::string | indent_str () const |
void | increase_indent () |
void | decrease_indent () |
void | increase_indent_spaces (int n) |
void | decrease_indent_spaces (int n) |
Log & | indent () |
template<typename T > | |
Log & | indent (const T &t) |
Same as verbatim, but uses stringstream to convert to string first. More... | |
Static Public Member Functions | |
static std::string | invalid_verbosity_msg (std::string s) |
static std::pair< bool, int > | verbosity_level (std::string s) |
Read verbosity level from a string. More... | |
Static Public Attributes | |
static const int | none = 0 |
static const int | quiet = 5 |
static const int | standard = 10 |
static const int | verbose = 20 |
static const int | debug = 100 |
Private Member Functions | |
template<int _required_verbosity = standard> | |
void | _add (const std::string &type, const std::string &what) |
void | _print_justified_line (std::vector< std::string > &line, int curr_width) |
void | _print_left_justified_line (std::vector< std::string > &line, int curr_width) |
void | _print_right_justified_line (std::vector< std::string > &line, int curr_width) |
void | _print_center_justified_line (std::vector< std::string > &line, int curr_width) |
void | _print_full_justified_line (std::vector< std::string > &line, int curr_width) |
void | _add_time () |
bool | _print () const |
Private Attributes | |
std::vector< int > | m_required_verbosity |
int | m_verbosity |
If m_verbosity >= required verbosity, then print. More... | |
bool | m_print |
Whether to print. More... | |
bool | m_show_clock |
int | m_indent_space |
indent_str = m_indent_space*m_indent_level + m_indent_spaces More... | |
int | m_indent_level |
int | m_indent_spaces |
int | m_paragraph_width |
JustificationType | m_justification |
boost::chrono::steady_clock::time_point | m_start_time |
boost::chrono::steady_clock::time_point | m_lap_start_time |
std::ostream * | m_ostream |
Friends | |
template<typename T > | |
Log & | operator<< (Log &log, const T &msg_details) |
Log & | operator<< (Log &log, std::ostream &(*fptr)(std::ostream &)) |
CASM::Log::Log | ( | std::ostream & | _ostream = std::cout , |
int | _verbosity = standard , |
||
bool | _show_clock = false , |
||
int | _indent_space = 2 |
||
) |
|
inlineprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
|
inline |
Log & CASM::Log::paragraph | ( | std::string | text | ) |
Print indented paragraph with wrapping at Log::width()
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Create a subsection.
Example:
Log & CASM::Log::verbatim | ( | std::string | text, |
bool | indent_first_line = true |
||
) |
Log & CASM::Log::verbatim_list | ( | OutputIterator | begin, |
OutputIterator | end, | ||
std::string | sep = "- " |
||
) |
Print a list.
Example, with initial indent of 2 spaces, and sep="-- ":
|
static |
|
inline |
|
inline |
|
private |
|
private |
|
private |
|
private |
|
private |