Apollo 10.0
自动驾驶开放平台
monitor_log_buffer.cc
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
18
19#include "cyber/common/log.h"
20
21namespace apollo {
22namespace common {
23namespace monitor {
24
28
30 if (!monitor_msg_items_.empty()) {
31 logger_->Publish(source_, monitor_msg_items_);
32 monitor_msg_items_.clear();
34 }
35}
36
38
40 const MonitorMessageItem::LogLevel log_level, const std::string &msg) {
41 level_ = log_level;
42 monitor_msg_items_.push_back(std::make_pair(log_level, msg));
43}
44
45} // namespace monitor
46} // namespace common
47} // namespace apollo
void AddMonitorMsgItem(const MonitorMessageItem::LogLevel log_level, const std::string &msg)
Add monitor message with MonitorMessageItem::LogLevel
MonitorLogBuffer(const MonitorMessageItem::MessageSource &source)
The constructor of MonitorBuffer.
void Publish()
publish the monitor messages
virtual void Publish(const MonitorMessageItem::MessageSource &source, const std::vector< MessageItem > &messages) const
Publish the messages.
The class of MonitorLogBuffer
class register implement
Definition arena_queue.h:37