Skip to content

Instantly share code, notes, and snippets.

View jzgriffin's full-sized avatar

Jeremiah Griffin jzgriffin

View GitHub Profile
@jzgriffin
jzgriffin / Format.cpp
Created December 8, 2012 20:57
C++ Logging Class
#include "Format.hpp"
#include <iomanip>
std::ostream& operator<<(std::ostream& out, std::tm* dt)
{
return out // ISO 8601 without timezone
<< std::setfill('0') << std::setw(4) << dt->tm_year + 1900 << "-"
<< std::setfill('0') << std::setw(2) << dt->tm_mday << "-"
<< std::setfill('0') << std::setw(2) << dt->tm_mon + 1 << " "
<< std::setfill('0') << std::setw(2) << dt->tm_hour << ":"