1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file src/util/MessageSystem.cpp
15 #include "util/MessageSystem.h"
19 void MessageSystem::writeMessage(MessageSystem::MessageLevel level
, const std::string
&message
) {
20 std::time_t t
= std::time(NULL
);
22 struct tm
*lt
= std::localtime(&t
);
24 std::string time
= Util::StreamAsString() << lt
->tm_hour
<< ":" << lt
->tm_min
<< ":" << lt
->tm_sec
;
26 std::printf("[%02i:%02i:%02i %5s] ", lt
->tm_hour
, lt
->tm_min
, lt
->tm_sec
, LevelString(level
));
27 std::puts(message
.c_str());
29 if(level
== Fatal
) exit(1);