ealogger
ealogger is a c++ library that provides a blazing fast and easy to use logging mechanism
Namespaces | Functions
utility.h File Reference

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.

Namespaces

 ealogger
 Main namespace for ealogger.
 
 utility
 Namespace for ealogger utility functions.
 

Functions

std::string ealogger::utility::get_hostname ()
 Get local hostname. More...
 
std::string ealogger::utility::get_file_name (const std::string &absolute_path)
 Get the last element of a path. More...
 
void ealogger::utility::stack_trace (unsigned int size, std::vector< std::string > &stack_msg_vec)
 Print a demangled stacktrace. More...
 
std::string ealogger::utility::format_time_to_string (std::time_t t, const std::string &time_format)
 Get a formatted time string based on. More...
 
std::string ealogger::utility::format_time_to_string (const std::string &time_format)
 Get a formatted time string based. More...
 

Detailed Description

Header with utility functions for ealogger.

Function Documentation

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
tstd::time_t object that will be converted to string
time_formatconversion 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_formatconversion 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
absolute_path
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
sizeHow many elements of the stack this should capture
stack_msg_vecReference to a vector of strings where all stack elements will be stored
Note
The method only works with gcc/llvm compiled software