src/fw-logs/fw-logs-formating-options.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
4 #include "fw-logs-xml-helper.h"
5 #include <sstream>
6 
7 
8 using namespace std;
9 namespace librealsense
10 {
11  namespace fw_logs
12  {
13  fw_log_event::fw_log_event()
14  : num_of_params(0),
15  line("")
16  {}
17 
18  fw_log_event::fw_log_event(int input_num_of_params, const string& input_line)
19  : num_of_params(input_num_of_params),
20  line(input_line)
21  {}
22 
23 
25  : _xml_content(xml_content)
26  {}
27 
28 
30  {
31  }
32 
33  bool fw_logs_formating_options::get_event_data(int id, fw_log_event* log_event_data) const
34  {
35  auto event_it = _fw_logs_event_list.find(id);
36  if (event_it != _fw_logs_event_list.end())
37  {
38  *log_event_data = event_it->second;
39  return true;
40  }
41  else
42  {
43  stringstream ss;
44  ss << "*** Unrecognized Log Id: ";
45  ss << id;
46  ss << "! P1 = 0x{0:x}, P2 = 0x{1:x}, P3 = 0x{2:x}";
47  log_event_data->line = ss.str();
48  log_event_data->num_of_params = 3;
49  return false;
50  }
51  }
52 
54  {
55  auto file_it = _fw_logs_file_names_list.find(id);
56  if (file_it != _fw_logs_file_names_list.end())
57  {
58  *file_name = file_it->second;
59  return true;
60  }
61  else
62  {
63  *file_name = "Unknown";
64  return false;
65  }
66  }
67 
68  bool fw_logs_formating_options::get_thread_name(uint32_t thread_id, string* thread_name) const
69  {
70  auto file_it = _fw_logs_thread_names_list.find(thread_id);
71  if (file_it != _fw_logs_thread_names_list.end())
72  {
73  *thread_name = file_it->second;
74  return true;
75  }
76  else
77  {
78  *thread_name = "Unknown";
79  return false;
80  }
81  }
82 
83  std::unordered_map<string, std::vector<kvp>> fw_logs_formating_options::get_enums() const
84  {
86  }
87 
89  {
90  fw_logs_xml_helper fw_logs_xml(_xml_content);
91  return fw_logs_xml.build_log_meta_data(this);
92  }
93  }
94 }
95 
bool get_event_data(int id, fw_log_event *log_event_data) const
GLenum GLuint id
unsigned int uint32_t
Definition: stdint.h:80
bool get_thread_name(uint32_t thread_id, std::string *thread_name) const
std::unordered_map< std::string, std::vector< kvp > > get_enums() const
std::unordered_map< std::string, std::vector< std::pair< int, std::string > > > _fw_logs_enum_names_list
bool build_log_meta_data(fw_logs_formating_options *logs_formating_options)


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:15