Kea  1.9.9-git
log_utils.h
Go to the documentation of this file.
1 // Copyright (C) 2016-2020 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef TEST_LOG_UTILS_H
8 #define TEST_LOG_UTILS_H
9 
10 #include <string>
11 #include <fstream>
12 
13 //#include <config.h>
14 
15 #include <log/logger_manager.h>
16 #include <log/logger_name.h>
17 #include <log/logger_support.h>
18 
19 //#include <boost/shared_ptr.hpp>
20 //#include <boost/scoped_ptr.hpp>
21 #include <gtest/gtest.h>
22 
23 using namespace std;
24 using namespace isc::log;
25 
26 namespace isc {
27 namespace dhcp {
28 namespace test {
29 
39 
40 class LogContentTest : public ::testing::Test {
41 public:
42 
50 
51  virtual ~LogContentTest();
52 
61  bool checkFile();
62 
68  size_t countFile(const string& exp_string);
69 
71  void remFile();
72 
78  void logCheckVerbose(bool talk_a_lot) {
79  verbose_ = talk_a_lot;
80  }
81 
86  void addString(const string& new_string);
87 
88  vector<string> exp_strings_;
89  static const char* LOG_FILE;
90  static const char* KEA_LOG_CHECK_VERBOSE;
91 
100  bool verbose_;
101 };
102 
103 } // end of isc::dhcp::test namespace
104 } // end of isc::dhcp namespace
105 } // end of isc namespace
106 #endif // TEST_LOG_UTILS_H
Test class for testing things that emit log entries.
Definition: log_utils.h:40
void logCheckVerbose(bool talk_a_lot)
Enables or disables verbose mode.
Definition: log_utils.h:78
STL namespace.
static const char * LOG_FILE
Definition: log_utils.h:89
bool verbose_
controls whether the checkFile() should print more details.
Definition: log_utils.h:100
static const char * KEA_LOG_CHECK_VERBOSE
Definition: log_utils.h:90
vector< string > exp_strings_
Definition: log_utils.h:88
Defines the logger used by the top-level component of kea-dhcp-ddns.
Logging initialization functions.