1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 11:12:16 +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:
Alex Melman 2021-02-23 15:24:02 +02:00 committed by main
parent f9828a1252
commit 5c992d6a93
4 changed files with 8015 additions and 4 deletions

View file

@ -5,13 +5,12 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- name: Check out repository
uses: actions/checkout@v2
with:
depth: 1
with:
submodules: 'recursive'
- name: Run Cppcheck
uses: Bedzior/run-cppcheck@master

View file

@ -251,6 +251,7 @@ set(TDUTILS_SOURCE
td/utils/ThreadLocalStorage.h
td/utils/ThreadSafeCounter.h
td/utils/Time.h
td/utils/date.h
td/utils/TimedStat.h
td/utils/Timer.h
td/utils/TsFileLog.h

8007
tdutils/td/utils/date.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -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()) {