Fix Logger const-correctness.

GitOrigin-RevId: 437ed337638a9841f7695fd77b89191f1b36c584
This commit is contained in:
levlam 2020-09-02 17:10:10 +03:00
parent 77678b730c
commit 07237a18be
3 changed files with 4 additions and 4 deletions

View File

@ -124,7 +124,7 @@ int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) {
int err = X509_STORE_CTX_get_error(ctx);
auto warning = PSTRING() << "verify error:num=" << err << ":" << X509_verify_cert_error_string(err)
<< ":depth=" << X509_STORE_CTX_get_error_depth(ctx) << ":" << buf;
<< ":depth=" << X509_STORE_CTX_get_error_depth(ctx) << ":" << Slice(buf, std::strlen(buf));
double now = Time::now();
static std::mutex warning_mutex;

View File

@ -174,7 +174,7 @@ inline StringBuilder &operator<<(StringBuilder &logger, Time t) {
while (i + 1 < durations_n && t.seconds_ > 10 * durations[i + 1].value) {
i++;
}
logger << StringBuilder::FixedDouble(t.seconds_ / durations[i].value, 1) << durations[i].name;
logger << StringBuilder::FixedDouble(t.seconds_ / durations[i].value, 1) << Slice(durations[i].name);
return logger;
}
@ -200,7 +200,7 @@ inline StringBuilder &operator<<(StringBuilder &logger, Size t) {
while (i + 1 < sizes_n && t.size_ > 10 * sizes[i + 1].value) {
i++;
}
logger << t.size_ / sizes[i].value << sizes[i].name;
logger << t.size_ / sizes[i].value << Slice(sizes[i].name);
return logger;
}

View File

@ -251,7 +251,7 @@ class Logger {
Logger(LogInterface &log, const LogOptions &options, int log_level, Slice file_name, int line_num, Slice comment);
template <class T>
Logger &operator<<(const T &other) {
Logger &operator<<(T &&other) {
sb_ << other;
return *this;
}