deactivate the cool put_time thing in C++11 as GCC craps out again
This commit is contained in:
parent
e12ad48822
commit
cc982a578d
@ -40,7 +40,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iomanip>
|
// #include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
RequestHandler::RequestHandler() : routing_machine(NULL) { }
|
RequestHandler::RequestHandler() : routing_machine(NULL) { }
|
||||||
@ -51,10 +51,26 @@ void RequestHandler::handle_request(const http::Request& req, http::Reply& rep){
|
|||||||
std::string request;
|
std::string request;
|
||||||
URIDecode(req.uri, request);
|
URIDecode(req.uri, request);
|
||||||
|
|
||||||
std::time_t t = std::time(nullptr);
|
// deactivated as GCC apparently does not implement that, not even in 4.9
|
||||||
|
// std::time_t t = std::time(nullptr);
|
||||||
|
// SimpleLogger().Write() << std::put_time(std::localtime(&t), "%m-%d-%Y %H:%M:%S") <<
|
||||||
|
// " " << req.endpoint.to_string() << " " <<
|
||||||
|
// req.referrer << ( 0 == req.referrer.length() ? "- " :" ") <<
|
||||||
|
// req.agent << ( 0 == req.agent.length() ? "- " :" ") << request;
|
||||||
|
|
||||||
SimpleLogger().Write() << std::put_time(std::localtime(&t), "%m-%d-%Y %H:%M:%S") <<
|
time_t ltime;
|
||||||
" " << req.endpoint.to_string() << " " <<
|
struct tm *Tm;
|
||||||
|
|
||||||
|
ltime=time(NULL);
|
||||||
|
Tm=localtime(<ime);
|
||||||
|
|
||||||
|
SimpleLogger().Write() <<
|
||||||
|
(Tm->tm_mday < 10 ? "0" : "" ) << Tm->tm_mday << "-" <<
|
||||||
|
(Tm->tm_mon+1 < 10 ? "0" : "" ) << (Tm->tm_mon+1) << "-" <<
|
||||||
|
1900+Tm->tm_year << " " << (Tm->tm_hour < 10 ? "0" : "" ) <<
|
||||||
|
Tm->tm_hour << ":" << (Tm->tm_min < 10 ? "0" : "" ) <<
|
||||||
|
Tm->tm_min << ":" << (Tm->tm_sec < 10 ? "0" : "" ) <<
|
||||||
|
Tm->tm_sec << " " << req.endpoint.to_string() << " " <<
|
||||||
req.referrer << ( 0 == req.referrer.length() ? "- " :" ") <<
|
req.referrer << ( 0 == req.referrer.length() ? "- " :" ") <<
|
||||||
req.agent << ( 0 == req.agent.length() ? "- " :" ") << request;
|
req.agent << ( 0 == req.agent.length() ? "- " :" ") << request;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user