FileLoggingStrategy.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*
4  * This file is part of ArmarX.
5  *
6  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
7  *
8  * ArmarX is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * ArmarX is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * @package ArmarXCore::core::services::profiler
21  * @author Manfred Kroehnert ( manfred dot kroehnert at dot kit dot edu )
22  * @date 2015
23  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
24  * GNU General Public License
25  */
26 
27 
28 #include "LoggingStrategy.h"
29 
30 #include <vector>
31 #include <mutex>
32 
33 namespace armarx::Profiler
34 {
35  class FileLoggingStrategy;
36  using FileLoggingStrategyPtr = std::shared_ptr<FileLoggingStrategy>;
37 
38  /**
39  * @class FileLoggingStrategy
40  * @ingroup Profiling
41  * @brief A brief description
42  *
43  * Detailed Description
44  */
46  virtual public LoggingStrategy
47  {
48  public:
50 
51  ~FileLoggingStrategy() override;
52 
53  void logEvent(pid_t processId, uint64_t timestamp, const std::string& executableName, const std::string& timestampUnit, const std::string& eventName, const std::string& parentName, const std::string& functionName) override;
54  private:
55  void writeFile();
56  void writeHeader(std::ostream& outputStream);
57 
58  std::mutex mutex;
59  std::vector<std::string> eventList;
60  };
61 }
armarx::Profiler::FileLoggingStrategy::~FileLoggingStrategy
~FileLoggingStrategy() override
Definition: FileLoggingStrategy.cpp:82
armarx::Profiler
Definition: ManagedIceObject.h:72
armarx::Profiler::FileLoggingStrategy::FileLoggingStrategy
FileLoggingStrategy()
Definition: FileLoggingStrategy.cpp:78
armarx::Profiler::LoggingStrategy
A brief description.
Definition: LoggingStrategy.h:50
armarx::Profiler::FileLoggingStrategy::logEvent
void logEvent(pid_t processId, uint64_t timestamp, const std::string &executableName, const std::string &timestampUnit, const std::string &eventName, const std::string &parentName, const std::string &functionName) override
Definition: FileLoggingStrategy.cpp:35
armarx::Profiler::FileLoggingStrategy
A brief description.
Definition: FileLoggingStrategy.h:45
LoggingStrategy.h
armarx::Profiler::FileLoggingStrategyPtr
std::shared_ptr< FileLoggingStrategy > FileLoggingStrategyPtr
Definition: FileLoggingStrategy.h:36