mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Using Howard Hinnant's free, open-source header-only and thread-safe datetime library.
https://howardhinnant.github.io/date/date.html All logs will display a datetime in format "2021-02-23 12:57:21.1023272" UTC, instead of simply displaying double formatted timestamp. Update ccpp-linux.yml Soon github actions will use ubuntu 20.04 as latest. Let's avoid surprised and stick to ubuntu-18.04 fow now.
This commit is contained in:
parent
f9828a1252
commit
5c992d6a93
4 changed files with 8015 additions and 4 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "td/utils/port/thread_local.h"
|
||||
#include "td/utils/Slice.h"
|
||||
#include "td/utils/Time.h"
|
||||
#include "td/utils/date.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdlib>
|
||||
|
@ -65,6 +66,8 @@ Logger::Logger(LogInterface &log, const LogOptions &options, int log_level, Slic
|
|||
return;
|
||||
}
|
||||
|
||||
using namespace date;
|
||||
|
||||
// log level
|
||||
sb_ << '[';
|
||||
if (log_level < 10) {
|
||||
|
@ -81,7 +84,8 @@ Logger::Logger(LogInterface &log, const LogOptions &options, int log_level, Slic
|
|||
sb_ << thread_id << ']';
|
||||
|
||||
// timestamp
|
||||
sb_ << '[' << StringBuilder::FixedDouble(Clocks::system(), 9) << ']';
|
||||
//sb_ << '[' << StringBuilder::FixedDouble(Clocks::system(), 9) << ']';
|
||||
sb_ << '[' << date::format("%F %T", std::chrono::system_clock::now()) << ']';
|
||||
|
||||
// file : line
|
||||
if (!file_name.empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue