Header with utility functions for ealogger.
More...
#include <unistd.h>
#include <algorithm>
#include <ctime>
#include <regex>
#include <string>
Go to the source code of this file.
|
| ealogger |
| Main namespace for ealogger.
|
|
| utility |
| Namespace for ealogger utility functions.
|
|
Header with utility functions for ealogger.
std::string ealogger::utility::format_time_to_string |
( |
std::time_t |
t, |
|
|
const std::string & |
time_format |
|
) |
| |
|
inline |
Get a formatted time string based on.
- Parameters
-
t | std::time_t object that will be converted to string |
time_format | conversion pattern |
- Returns
- Converted time object as string
This is an overloaded version of format_time_to_string(std::string)
std::string ealogger::utility::format_time_to_string |
( |
const std::string & |
time_format | ) |
|
|
inline |
Get a formatted time string based.
- Parameters
-
time_format | conversion pattern |
- Returns
- Converted time object as string
Converts a std::time_t object using std::strftime based on the conversion patterns in time_format
- See also
- format_time_to_string(std::time_t, std::string)
std::string ealogger::utility::get_file_name |
( |
const std::string & |
absolute_path | ) |
|
|
inline |
Get the last element of a path.
- Parameters
-
- Returns
- Filename
std::string ealogger::utility::get_hostname |
( |
| ) |
|
|
inline |
Get local hostname.
- Returns
void ealogger::utility::stack_trace |
( |
unsigned int |
size, |
|
|
std::vector< std::string > & |
stack_msg_vec |
|
) |
| |
|
inline |
Print a demangled stacktrace.
- Parameters
-
size | How many elements of the stack this should capture |
stack_msg_vec | Reference to a vector of strings where all stack elements will be stored |
- Note
- The method only works with gcc/llvm compiled software