Improve logging to PLAIN.
GitOrigin-RevId: 5fd64a3599e599a7ae27eecc284f0cd898db8aca
This commit is contained in:
parent
eea76cdcc0
commit
ce137620f5
@ -4380,18 +4380,18 @@ void main(int argc, char **argv) {
|
||||
});
|
||||
auto res = options.run(argc, argv);
|
||||
if (res.is_error()) {
|
||||
LOG(ERROR) << res.error();
|
||||
LOG(PLAIN) << "tg_cli: " << res.error().message();
|
||||
LOG(PLAIN) << options;
|
||||
return;
|
||||
}
|
||||
if (!res.ok().empty()) {
|
||||
LOG(ERROR) << "Have unexpected non-option parameters";
|
||||
LOG(PLAIN) << "tg_cli: " << "Have unexpected non-option parameters";
|
||||
LOG(PLAIN) << options;
|
||||
return;
|
||||
}
|
||||
|
||||
if (api_id == 0 || api_hash.empty()) {
|
||||
LOG(ERROR) << "You should provide some valid api_id and api_hash";
|
||||
LOG(PLAIN) << "tg_cli: " << "You should provide some valid api_id and api_hash";
|
||||
LOG(PLAIN) << options;
|
||||
return;
|
||||
}
|
||||
|
@ -45,6 +45,9 @@ TD_THREAD_LOCAL const char *Logger::tag2_ = nullptr;
|
||||
Logger::Logger(LogInterface &log, const LogOptions &options, int log_level, Slice file_name, int line_num,
|
||||
Slice comment)
|
||||
: Logger(log, options, log_level) {
|
||||
if (log_level == VERBOSITY_NAME(PLAIN) && &options == &log_options) {
|
||||
return;
|
||||
}
|
||||
if (!options_.add_info) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user