Fledge
An open source edge computing platform for industrial users
audit_logger.h
1 #ifndef _AUDIT_LOGGER_H
2 #define _AUDIT_LOGGER_H
3 /*
4  * Fledge Singleton Audit Logger interface
5  *
6  * Copyright (c) 2023 Dianomic Systems
7  *
8  * Released under the Apache 2.0 Licence
9  *
10  * Author: Mark Riddoch
11  */
12 
13 #include <logger.h>
14 #include <management_client.h>
15 #include <string>
16 
21 class AuditLogger {
22  public:
24  ~AuditLogger();
25 
26  static AuditLogger *getLogger();
27  static void auditLog(const std::string& code,
28  const std::string& level,
29  const std::string& data = "");
30 
31  void audit(const std::string& code,
32  const std::string& level,
33  const std::string& data = "");
34 
35  private:
36  static AuditLogger *m_instance;
37  ManagementClient *m_mgmt;
38 };
39 #endif
~AuditLogger()
Destructor for an audit logger.
Definition: audit_logger.cpp:33
void audit(const std::string &code, const std::string &level, const std::string &data="")
Log an audit message.
Definition: audit_logger.cpp:71
The management client class used by services and tasks to communicate with the management API of the ...
Definition: management_client.h:43
static AuditLogger * getLogger()
Get the audit logger singleton.
Definition: audit_logger.cpp:40
A singleton class for access to the audit logger within services.
Definition: audit_logger.h:21
AuditLogger(ManagementClient *mgmt)
Constructor for an audit logger that is passed the management client.
Definition: audit_logger.cpp:25