aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Log.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2022-03-29 16:43:19 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2022-03-29 16:43:19 +0200
commit6d1d9f47edef8352c6f25d7736171ec2bbe5471a (patch)
treeb9194956abb0f672c16b1136b90f59448cb86b75 /lib/Log.cpp
parentcf58fa375c003173215baf81b4b64cf4e5c1873c (diff)
downloaddabmux-6d1d9f47edef8352c6f25d7736171ec2bbe5471a.tar.gz
dabmux-6d1d9f47edef8352c6f25d7736171ec2bbe5471a.tar.bz2
dabmux-6d1d9f47edef8352c6f25d7736171ec2bbe5471a.zip
Common: log timestamps, socket changes and frame_timestamp_t
Diffstat (limited to 'lib/Log.cpp')
-rw-r--r--lib/Log.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Log.cpp b/lib/Log.cpp
index abbd69a..089e822 100644
--- a/lib/Log.cpp
+++ b/lib/Log.cpp
@@ -25,6 +25,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <iomanip>
#include <list>
#include <cstdarg>
#include <cinttypes>
@@ -119,7 +120,9 @@ void Logger::io_process()
}
if (m.level != log_level_t::trace) {
- std::cerr << levels_as_str[m.level] << " " << message << std::endl;
+ using namespace std::chrono;
+ time_t t = system_clock::to_time_t(system_clock::now());
+ cerr << put_time(std::gmtime(&t), "%Y-%m-%dZ%H:%M:%S") << " " << levels_as_str[m.level] << " " << message << endl;
}
}
}