Fix empty path in FileLog.
GitOrigin-RevId: be64892045a8ee3497f89963d8f18265b4f6991d
This commit is contained in:
parent
ff97775549
commit
c40a1217e8
@ -18,13 +18,13 @@
|
|||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
Status FileLog::init(string path, int64 rotate_threshold, bool redirect_stderr) {
|
Status FileLog::init(string path, int64 rotate_threshold, bool redirect_stderr) {
|
||||||
|
if (path.empty()) {
|
||||||
|
return Status::Error("Log file path can't be empty");
|
||||||
|
}
|
||||||
if (path == path_) {
|
if (path == path_) {
|
||||||
set_rotate_threshold(rotate_threshold);
|
set_rotate_threshold(rotate_threshold);
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
if (path.empty()) {
|
|
||||||
return Status::Error("Log file path can't be empty");
|
|
||||||
}
|
|
||||||
|
|
||||||
TRY_RESULT(fd, FileFd::open(path, FileFd::Create | FileFd::Write | FileFd::Append));
|
TRY_RESULT(fd, FileFd::open(path, FileFd::Create | FileFd::Write | FileFd::Append));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user