F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ActiveTextLogger.hpp
Go to the documentation of this file.
1 // \copyright
2 // Copyright 2009-2015, by the California Institute of Technology.
3 // ALL RIGHTS RESERVED. United States Government Sponsorship
4 // acknowledged.
5 
6 #ifndef ACTIVETEXTLOGGERIMPL_HPP_
7 #define ACTIVETEXTLOGGERIMPL_HPP_
8 
12 #include <config/ActiveTextLoggerCfg.hpp>
13 
14 namespace Svc {
15 
23 
25  friend class ActiveTextLoggerTester;
26 
27  public:
36  explicit ActiveTextLogger(const char* compName);
37 
40  virtual ~ActiveTextLogger();
41 
52  bool set_log_file(const char* fileName, const U32 maxSize, const U32 maxBackups = 10);
53 
55  void configure(const FwEventIdType* filteredIds, FwSizeType count);
56 
60  void setSeverityFilter(Fw::LogSeverity severity, bool enabled);
61 
62  private:
63  // ----------------------------------------------------------------------
64  // Prohibit Copying
65  // ----------------------------------------------------------------------
66 
71 
75  ActiveTextLogger& operator=(const ActiveTextLogger&);
76 
77  // ----------------------------------------------------------------------
78  // Constants/Types
79  // ----------------------------------------------------------------------
80 
81  // ----------------------------------------------------------------------
82  // Member Functions
83  // ----------------------------------------------------------------------
84 
85  // ----------------------------------------------------------------------
86  // Handlers to implement for typed input ports
87  // ----------------------------------------------------------------------
88 
90  //
91  virtual void TextLogger_handler(FwIndexType portNum,
92  FwEventIdType id,
93  Fw::Time& timeTag,
94  const Fw::LogSeverity& severity,
95  Fw::TextLogString& text
96  );
97 
98  // ----------------------------------------------------------------------
99  // Internal interface handlers
100  // ----------------------------------------------------------------------
101 
104  virtual void TextQueue_internalInterfaceHandler(const Fw::InternalInterfaceString& text
105  );
106 
107  // ----------------------------------------------------------------------
108  // Member Variables
109  // ----------------------------------------------------------------------
110 
111  // The optional file to text logs to:
112  LogFile m_log_file;
113 
114  // Event ID filters
115  FwSizeType m_numFilteredIDs;
117 
118  // Severity filter
119  EventSeverityFilter m_severityFilter;
120 };
121 
122 } // namespace Svc
123 #endif /* ACTIVETEXTLOGGERIMPL_HPP_ */
void configure(const FwEventIdType *filteredIds, FwSizeType count)
Configure component with event ID filters.
void setSeverityFilter(Fw::LogSeverity severity, bool enabled)
PlatformSizeType FwSizeType
friend class ActiveTextLoggerTester
LogFile struct.
Definition: LogFile.hpp:21
ActiveTextLogger(const char *compName)
Component constructor.
FwIdType FwEventIdType
The type of an event identifier.
virtual ~ActiveTextLogger()
Component destructor.
Enum representing event severity.
Auto-generated base for ActiveTextLogger component.
Common severity-based event filtering utility.
PlatformIndexType FwIndexType
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
RateGroupDivider component implementation.