mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-26 18:18:27 +00:00
Update TDLib and use AsyncFileLog instead of FileLog.
This commit is contained in:
parent
3be8cb6323
commit
b44bc1cabd
2
td
2
td
@ -1 +1 @@
|
||||
Subproject commit a7a17b34b3c8fd3f7f6295f152746beb68f34d83
|
||||
Subproject commit c1a3fa633fbce67b8b89fee93130498db8adc039
|
@ -6593,7 +6593,7 @@ td::Result<td_api::object_ptr<td_api::chatPermissions>> Client::get_chat_permiss
|
||||
}();
|
||||
|
||||
if (status.is_error()) {
|
||||
return Status::Error(400, PSLICE() << "Can't parse chat permissions: " << status.error().message());
|
||||
return Status::Error(400, PSLICE() << "Can't parse chat permissions: " << status.message());
|
||||
}
|
||||
} else if (allow_legacy) {
|
||||
allow_legacy = false;
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "td/utils/Parser.h"
|
||||
#include "td/utils/port/IPAddress.h"
|
||||
#include "td/utils/port/Stat.h"
|
||||
#include "td/utils/port/thread.h"
|
||||
#include "td/utils/Slice.h"
|
||||
#include "td/utils/SliceBuilder.h"
|
||||
#include "td/utils/StackAllocator.h"
|
||||
@ -38,6 +39,7 @@
|
||||
#include "memprof/memprof.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <tuple>
|
||||
|
||||
namespace telegram_bot_api {
|
||||
@ -341,7 +343,7 @@ void ClientManager::start_up() {
|
||||
auto concurrent_webhook_db = td::make_unique<td::BinlogKeyValue<td::ConcurrentBinlog>>();
|
||||
auto status = concurrent_webhook_db->init(parameters_->working_directory_ + "webhooks_db.binlog", td::DbKey::empty(),
|
||||
scheduler_id);
|
||||
LOG_IF(FATAL, status.is_error()) << "Can't open webhooks_db.binlog " << status.error();
|
||||
LOG_IF(FATAL, status.is_error()) << "Can't open webhooks_db.binlog " << status;
|
||||
parameters_->shared_data_->webhook_db_ = std::move(concurrent_webhook_db);
|
||||
|
||||
auto &webhook_db = *parameters_->shared_data_->webhook_db_;
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "td/utils/StringBuilder.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
//
|
||||
#include "telegram-bot-api/Watchdog.h"
|
||||
|
||||
#include "td/utils/logging.h"
|
||||
#include "td/utils/Time.h"
|
||||
|
||||
namespace telegram_bot_api {
|
||||
|
@ -20,11 +20,11 @@
|
||||
#include "td/actor/actor.h"
|
||||
#include "td/actor/ConcurrentScheduler.h"
|
||||
|
||||
#include "td/utils/AsyncFileLog.h"
|
||||
#include "td/utils/CombinedLog.h"
|
||||
#include "td/utils/common.h"
|
||||
#include "td/utils/crypto.h"
|
||||
#include "td/utils/ExitGuard.h"
|
||||
#include "td/utils/FileLog.h"
|
||||
//#include "td/utils/GitInfo.h"
|
||||
#include "td/utils/logging.h"
|
||||
#include "td/utils/MemoryLog.h"
|
||||
@ -44,7 +44,6 @@
|
||||
#include "td/utils/SliceBuilder.h"
|
||||
#include "td/utils/Status.h"
|
||||
#include "td/utils/Time.h"
|
||||
#include "td/utils/TsLog.h"
|
||||
|
||||
#include <atomic>
|
||||
#include <cstdlib>
|
||||
@ -315,8 +314,7 @@ int main(int argc, char *argv[]) {
|
||||
log.set_second(&memory_log);
|
||||
td::log_interface = &log;
|
||||
|
||||
td::FileLog file_log;
|
||||
td::TsLog ts_log(&file_log);
|
||||
td::AsyncFileLog file_log;
|
||||
|
||||
auto init_status = [&] {
|
||||
#if TD_HAVE_THREAD_AFFINITY
|
||||
@ -408,13 +406,13 @@ int main(int argc, char *argv[]) {
|
||||
log_file_path = working_directory + log_file_path;
|
||||
}
|
||||
TRY_STATUS_PREFIX(file_log.init(log_file_path, log_max_file_size), "Can't open log file: ");
|
||||
log.set_first(&ts_log);
|
||||
log.set_first(&file_log);
|
||||
}
|
||||
|
||||
return td::Status::OK();
|
||||
}();
|
||||
if (init_status.is_error()) {
|
||||
LOG(PLAIN) << init_status.error().message();
|
||||
LOG(PLAIN) << init_status.message();
|
||||
LOG(PLAIN) << options;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user