Commit 8ab4f5ce authored by Sebastian Wolf's avatar Sebastian Wolf

Added abs_diff and increased space for filenames in logger

parent c119f1e9
Pipeline #1802 failed with stages
in 12 minutes and 17 seconds
......@@ -43,6 +43,12 @@ namespace xerus {
return (_value < 0 ) ? -_value : _value;
}
///@brief: Calculates the absolute difference between the given values.
template<class T>
constexpr T abs_diff(const T& _a, const T& _b) noexcept {
return (_a > _b) ? (_a - _b) : (_b - _a);
}
///@brief: Calculates _a*_a.
template<class T>
......
......@@ -67,15 +67,15 @@ namespace xerus { namespace misc { namespace internal {
void log_timestamp(std::ostream &_out, const char* _file, int _line, const char* _lvl) {
log_timestamp(_out);
_out << std::setfill(' ') << std::setw(20) << std::left << xerus::misc::explode(_file, '/').back() << ':' \
_out << std::setfill(' ') << std::setw(25) << std::left << xerus::misc::explode(_file, '/').back() << ':' \
<< std::right << std::setfill(' ') << std::setw(4) <<_line << " : " \
<< std::setfill(' ') << std::setw(12) << std::left \
<< std::setfill(' ') << std::setw(15) << std::left \
<< std::string(_lvl) << ": ";
}
void log_timestamp(std::ostream &_out, const char* _lvl) {
log_timestamp(_out);
_out << std::setfill(' ') << std::setw(12) << std::left \
_out << std::setfill(' ') << std::setw(15) << std::left \
<< std::string(_lvl) << ": ";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment