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

  condition | If this is true, the message is printed and the program exits.
  msg | Message to print.

## ◆ check_info()

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

Conditionally log info level events.

Parameters

  condition | If this is true, the message is printed.
  msg | Message 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

  stream | Stream to check goodness of.
  name | Name 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

  condition | If this is true, the message is printed.
  msg | Message to print.

## ◆ log_error()

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

Log error level events.

Parameters

  msg | Message to print.

## ◆ log_info()

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

Log info level events.

Parameters

  msg | Message to print.

## ◆ log_warning()

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

Log warning level events.

Parameters

  msg | Message to print.