未验证 提交 f1e61f04 编写于 作者: 卑己自牧's avatar 卑己自牧 提交者: GitHub

fix vlog print problem in fleet (#44011)

* fix vlog print problem in fleet

* fix log_patch.h code style
上级 755438a7
...@@ -38,6 +38,7 @@ limitations under the License. */ ...@@ -38,6 +38,7 @@ limitations under the License. */
#ifdef PADDLE_WITH_HETERPS #ifdef PADDLE_WITH_HETERPS
#include "paddle/fluid/platform/device/gpu/gpu_types.h" #include "paddle/fluid/platform/device/gpu/gpu_types.h"
#endif #endif
#include "paddle/fluid/framework/fleet/heter_ps/log_patch.h"
namespace paddle { namespace paddle {
namespace framework { namespace framework {
......
/* Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <glog/logging.h>
#undef VLOG_IS_ON
#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel))
#undef COMPACT_GOOGLE_LOG_INFO
#define COMPACT_GOOGLE_LOG_INFO google::LogMessage(__FILE__, __LINE__)
#undef LOG
#define LOG(severity) COMPACT_GOOGLE_LOG_##severity.stream()
#undef LOG_IF
#define LOG_IF(severity, condition) \
static_cast<void>(0), \
!(condition) ? (void)0 : google::LogMessageVoidify() & LOG(severity)
#undef VLOG
#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel))
...@@ -59,6 +59,7 @@ limitations under the License. */ ...@@ -59,6 +59,7 @@ limitations under the License. */
#ifdef PADDLE_WITH_PSLIB #ifdef PADDLE_WITH_PSLIB
#include "downpour_accessor.h" // NOLINT #include "downpour_accessor.h" // NOLINT
#endif #endif
#include "paddle/fluid/framework/fleet/heter_ps/log_patch.h"
namespace paddle { namespace paddle {
namespace framework { namespace framework {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册