btllib
Functions
status.hpp File Reference
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <string>

Go to the source code of this file.

Functions

std::string btllib::get_time ()
 
void btllib::log_info (const std::string &msg)
 
void btllib::log_warning (const std::string &msg)
 
void btllib::log_error (const std::string &msg)
 
void btllib::check_info (bool condition, const std::string &msg)
 
void btllib::check_warning (bool condition, const std::string &msg)
 
void btllib::check_error (bool condition, const std::string &msg)
 
void btllib::check_stream (const std::ios &stream, const std::string &name)
 

Detailed Description

Functions for logging and error checking.

Function Documentation

◆ check_error()

void btllib::check_error ( bool  condition,
const std::string &  msg 
)
inline

Conditionally log error level events. The program exits if the condition is true.

Parameters
conditionIf this is true, the message is printed and the program exits.
msgMessage to print.

◆ check_info()

void btllib::check_info ( bool  condition,
const std::string &  msg 
)
inline

Conditionally log info level events.

Parameters
conditionIf this is true, the message is printed.
msgMessage to print.

◆ check_stream()

void btllib::check_stream ( const std::ios &  stream,
const std::string &  name 
)
inline

Check whether the stream is good. Program prints an error message and exits if not.

Parameters
streamStream to check goodness of.
nameName of the stream, e.g. filepath or stdin

◆ check_warning()

void btllib::check_warning ( bool  condition,
const std::string &  msg 
)
inline

Conditionally log warning level events.

Parameters
conditionIf this is true, the message is printed.
msgMessage to print.

◆ log_error()

void btllib::log_error ( const std::string &  msg)
inline

Log error level events.

Parameters
msgMessage to print.

◆ log_info()

void btllib::log_info ( const std::string &  msg)
inline

Log info level events.

Parameters
msgMessage to print.

◆ log_warning()

void btllib::log_warning ( const std::string &  msg)
inline

Log warning level events.

Parameters
msgMessage to print.