This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 5fba86d9faa branch-3.0: [Enhancement](log) Make log of vlog adjustment
clear (#43069)
5fba86d9faa is described below
commit 5fba86d9faa27fe159fefb5b710892edb65f9461
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Nov 7 14:15:59 2024 +0800
branch-3.0: [Enhancement](log) Make log of vlog adjustment clear (#43069)
before:
```
adjust log level success, origin level -1
```
no info log
now:
```
adjust vlog of vrow_distribution from 10 to -1 succeed
```
and have info log
Cherry-picked from #42997
Co-authored-by: zclllhhjj <[email protected]>
---
be/src/http/action/adjust_log_level.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/be/src/http/action/adjust_log_level.cpp
b/be/src/http/action/adjust_log_level.cpp
index 687639a9b58..a8644a0fb5f 100644
--- a/be/src/http/action/adjust_log_level.cpp
+++ b/be/src/http/action/adjust_log_level.cpp
@@ -17,8 +17,9 @@
#include <http/action/adjust_log_level.h>
+#include <tuple>
+
#include "common/logging.h"
-#include "common/status.h"
#include "http/http_channel.h"
#include "http/http_request.h"
@@ -26,7 +27,7 @@ namespace doris {
// **Note**: If the module_name does not exist in the vlog modules, vlog
// would create corresponding module for it.
-int handle_request(HttpRequest* req) {
+std::tuple<std::string, int, int> handle_request(HttpRequest* req) {
auto parse_param = [&req](std::string param) {
const auto& value = req->param(param);
if (value.empty()) {
@@ -38,13 +39,16 @@ int handle_request(HttpRequest* req) {
const auto& module = parse_param("module");
const auto& level = parse_param("level");
int new_level = std::stoi(level);
- return google::SetVLOGLevel(module.c_str(), new_level);
+ return std::make_tuple(module, google::SetVLOGLevel(module.c_str(),
new_level), new_level);
}
void AdjustLogLevelAction::handle(HttpRequest* req) {
try {
- auto old_level = handle_request(req);
- auto msg = fmt::format("adjust log level success, origin level is {}",
old_level);
+ auto handle_result = handle_request(req);
+ auto msg =
+ fmt::format("adjust vlog of {} from {} to {} succeed",
std::get<0>(handle_result),
+ std::get<1>(handle_result),
std::get<2>(handle_result));
+ LOG(INFO) << msg;
HttpChannel::send_reply(req, msg);
} catch (const std::exception& e) {
HttpChannel::send_reply(req, HttpStatus::INTERNAL_SERVER_ERROR,
e.what());
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]