Kea 1.5.0
log_utils.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
23using namespace std;
24using namespace isc::log;
25
26namespace isc {
27namespace dhcp {
28namespace test {
29
39
40class LogContentTest : public ::testing::Test {
41public:
42
50
51 virtual ~LogContentTest();
52
61 bool checkFile();
62
64 void remFile();
65
71 void logCheckVerbose(bool talk_a_lot) {
72 verbose_ = talk_a_lot;
73 }
74
79 void addString(const string& new_string);
80
81 vector<string> exp_strings_;
82 static const char* LOG_FILE;
83
91};
92
93
94
95}; // end of isc::dhcp::test namespace
96}; // end of isc::dhcp namespace
97}; // end of isc namespace
98
99#endif // TEST_LOG_UTILS_H
Test class for testing things that emit log entries.
Definition: log_utils.h:40
LogContentTest()
Initializes the logger setup for using in checking log statements.
Definition: log_utils.cc:16
bool verbose_
controls whether the checkFile() should print more details.
Definition: log_utils.h:90
bool checkFile()
check that the requested strings are in the test log file in the requested order.
Definition: log_utils.cc:41
void remFile()
remove the test log file
Definition: log_utils.cc:77
void logCheckVerbose(bool talk_a_lot)
Enables or disables verbose mode.
Definition: log_utils.h:71
vector< string > exp_strings_
Definition: log_utils.h:81
static const char * LOG_FILE
Definition: log_utils.h:82
void addString(const string &new_string)
Add a string to the vector of expected strings.
Definition: log_utils.cc:81
Logging initialization functions.
Defines the logger used by the top-level component of kea-dhcp-ddns.