add precise_timestamps setter

This commit is contained in:
gfgtdf 2014-04-24 19:46:32 +02:00
parent bbffa5e88a
commit 86b68cf8d6
2 changed files with 3 additions and 0 deletions

View file

@ -47,6 +47,7 @@ static std::ostream null_ostream(new null_streambuf);
static int indent = 0;
static bool timestamp = true;
static bool precise_timestamp = false;
static boost::posix_time::time_facet facet("%Y%m%d %H:%M:%S%F ");
static std::ostream *output_stream = NULL;
@ -74,6 +75,7 @@ tredirect_output_setter::~tredirect_output_setter()
typedef std::map<std::string, int> domain_map;
static domain_map *domains;
void timestamps(bool t) { timestamp = t; }
void precise_timestamps(bool pt) { precise_timestamp = pt; }
logger err("error", 0), warn("warning", 1), info("info", 2), debug("debug", 3);
log_domain general("general");

View file

@ -92,6 +92,7 @@ public:
};
void timestamps(bool);
void precise_timestamps(bool);
std::string get_timestamp(const time_t& t, const std::string& format="%Y%m%d %H:%M:%S ");
std::string get_timespan(const time_t& t);