F´ Flight Software - C/C++ Documentation  NASA-v1.5.0
A framework for building embedded system applications to NASA flight quality standards.
LogFile.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 SVCLOGFILE_HPP_
7 #define SVCLOGFILE_HPP_
8 
10 #include <Os/File.hpp>
11 #include <Os/FileSystem.hpp>
12 
13 
14 namespace Svc {
15 
21 
22  struct LogFile {
23 
26  LogFile();
27 
30  ~LogFile();
31 
32  // ----------------------------------------------------------------------
33  // Member Functions
34  // ----------------------------------------------------------------------
35 
42  bool set_log_file(const char* fileName, const U32 maxSize, const U32 maxBackups = 10);
43 
50  bool write_to_log(const char *const buf, const U32 size);
51 
52  // ----------------------------------------------------------------------
53  // Member Variables
54  // ----------------------------------------------------------------------
55 
56  // The name of the file to text logs to:
58 
59  // The file to write text logs to:
61 
62  // The max size of the text log file:
64 
65  // True if there is currently a open file to write text logs to:
66  bool m_openFile;
67 
68  // Current size of the file:
70  };
71 
72 }
73 #endif /* SVCLOGFILEL_HPP_ */
Svc::LogFile::set_log_file
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
Definition: LogFile.cpp:80
Fw::EightyCharString
Definition: EightyCharString.hpp:10
FileSystem.hpp
Svc::LogFile::~LogFile
~LogFile()
Destructor.
Definition: LogFile.cpp:27
EightyCharString.hpp
Svc::LogFile::m_fileName
Fw::EightyCharString m_fileName
Definition: LogFile.hpp:57
Svc::LogFile
LogFile struct.
Definition: LogFile.hpp:22
File.hpp
Svc::LogFile::write_to_log
bool write_to_log(const char *const buf, const U32 size)
Write the passed buf to the log if possible.
Definition: LogFile.cpp:39
Svc::LogFile::m_maxFileSize
U32 m_maxFileSize
Definition: LogFile.hpp:63
Svc
Definition: ActiveLoggerComponentAc.cpp:22
Svc::LogFile::LogFile
LogFile()
Constructor.
Definition: LogFile.cpp:21
Svc::LogFile::m_file
Os::File m_file
Definition: LogFile.hpp:60
Os::File
Definition: File.hpp:11
Svc::LogFile::m_currentFileSize
U32 m_currentFileSize
Definition: LogFile.hpp:69
Svc::LogFile::m_openFile
bool m_openFile
Definition: LogFile.hpp:66