Module: check_mk
Branch: master
Commit: 376b988be181506bf97d91e77f23feb8b8ea864a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=376b988be18150…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Aug 30 16:00:26 2018 +0200
Cleaned up LogCache header.
Removed dead code. Reordered fields/methods.
Change-Id: I67ee8788cd9a10901a4768f4b3133768ed7e7dfa
---
livestatus/src/LogCache.h | 20 ++++++--------------
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/livestatus/src/LogCache.h b/livestatus/src/LogCache.h
index 546a132..5044512 100644
--- a/livestatus/src/LogCache.h
+++ b/livestatus/src/LogCache.h
@@ -32,7 +32,6 @@
#include <memory>
#include <mutex>
#include "FileSystem.h"
-class Column;
class Logfile;
class Logger;
class MonitoringCore;
@@ -40,11 +39,6 @@ class MonitoringCore;
using logfiles_t = std::map<time_t, std::unique_ptr<Logfile>>;
class LogCache {
- MonitoringCore *_mc;
- unsigned long _max_cached_messages;
- unsigned long _num_at_last_check;
- logfiles_t _logfiles;
-
public:
std::mutex _lock;
@@ -52,23 +46,21 @@ public:
#ifdef CMC
void setMaxCachedMessages(unsigned long m);
#endif
- std::chrono::system_clock::time_point _last_index_update;
-
- const char *name() { return "log"; }
- const char *namePrefix() { return "logs"; }
void handleNewMessage(Logfile *logfile, time_t since, time_t until,
unsigned logclasses);
- Column *column(
- const char *colname); // override in order to handle current_
logfiles_t *logfiles() { return &_logfiles; };
void forgetLogfiles();
void updateLogfileIndex();
-
bool logCachePreChecks();
private:
+ MonitoringCore *const _mc;
+ unsigned long _max_cached_messages;
+ unsigned long _num_at_last_check;
+ logfiles_t _logfiles;
+ std::chrono::system_clock::time_point _last_index_update;
+
void scanLogfile(const fs::path &path, bool watch);
- logfiles_t::iterator findLogfileStartingBefore(time_t);
Logger *logger() const;
};