Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
aba37777
Commit
aba37777
authored
Aug 06, 2014
by
Tomek Mrugalski
🛰
Browse files
[3417] B10 => KEA renamed
parent
7ebd4f56
Changes
24
Hide whitespace changes
Inline
Side-by-side
src/bin/d2/bundy_d2_controller.cc
View file @
aba37777
...
...
@@ -52,8 +52,8 @@ D2Controller::D2Controller()
:
DControllerBase
(
d2_app_name_
,
d2_bin_name_
)
{
// set the spec file either from the environment or
// use the production value.
if
(
getenv
(
"
B10
_FROM_BUILD"
))
{
setSpecFileName
(
std
::
string
(
getenv
(
"
B10
_FROM_BUILD"
))
+
if
(
getenv
(
"
KEA
_FROM_BUILD"
))
{
setSpecFileName
(
std
::
string
(
getenv
(
"
KEA
_FROM_BUILD"
))
+
"/src/bin/d2/dhcp-ddns.spec"
);
}
else
{
setSpecFileName
(
D2_SPECFILE_LOCATION
);
...
...
src/bin/d2/d2_controller.cc
View file @
aba37777
...
...
@@ -50,8 +50,8 @@ D2Controller::D2Controller()
:
DControllerBase
(
d2_app_name_
,
d2_bin_name_
)
{
// set the spec file either from the environment or
// use the production value.
if
(
getenv
(
"
B10
_FROM_BUILD"
))
{
setSpecFileName
(
std
::
string
(
getenv
(
"
B10
_FROM_BUILD"
))
+
if
(
getenv
(
"
KEA
_FROM_BUILD"
))
{
setSpecFileName
(
std
::
string
(
getenv
(
"
KEA
_FROM_BUILD"
))
+
"/src/bin/d2/dhcp-ddns.spec"
);
}
else
{
setSpecFileName
(
D2_SPECFILE_LOCATION
);
...
...
src/bin/d2/d_controller.cc
View file @
aba37777
...
...
@@ -402,11 +402,11 @@ DControllerBase::~DControllerBase() {
// Provide an implementation until we figure out a better way to do this.
void
dhcp
::
Daemon
::
loggerInit
(
const
char
*
log_name
,
bool
verbose
)
{
setenv
(
"
B10
_LOCKFILE_DIR_FROM_BUILD"
,
"/tmp"
,
1
);
setenv
(
"
B10
_LOGGER_ROOT"
,
log_name
,
0
);
setenv
(
"
B10
_LOGGER_SEVERITY"
,
(
verbose
?
"DEBUG"
:
"INFO"
),
0
);
setenv
(
"
B10
_LOGGER_DBGLEVEL"
,
"99"
,
0
);
setenv
(
"
B10
_LOGGER_DESTINATION"
,
"stdout"
,
0
);
setenv
(
"
KEA
_LOCKFILE_DIR_FROM_BUILD"
,
"/tmp"
,
1
);
setenv
(
"
KEA
_LOGGER_ROOT"
,
log_name
,
0
);
setenv
(
"
KEA
_LOGGER_SEVERITY"
,
(
verbose
?
"DEBUG"
:
"INFO"
),
0
);
setenv
(
"
KEA
_LOGGER_DBGLEVEL"
,
"99"
,
0
);
setenv
(
"
KEA
_LOGGER_DESTINATION"
,
"stdout"
,
0
);
isc
::
log
::
initLogger
();
}
...
...
src/bin/d2/tests/d2_unittests.cc
View file @
aba37777
...
...
@@ -21,7 +21,7 @@ main(int argc, char* argv[]) {
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
// See the documentation of the
B10
_* environment variables in
// See the documentation of the
KEA
_* environment variables in
// src/lib/log/README for info on how to tweak logging
isc
::
log
::
initLogger
();
...
...
src/bin/d2/tests/d_test_stubs.cc
View file @
aba37777
...
...
@@ -157,8 +157,8 @@ DStubController::DStubController()
:
DControllerBase
(
stub_app_name_
,
stub_bin_name_
),
processed_signals_
(),
record_signal_only_
(
false
)
{
if
(
getenv
(
"
B10
_FROM_BUILD"
))
{
setSpecFileName
(
std
::
string
(
getenv
(
"
B10
_FROM_BUILD"
))
+
if
(
getenv
(
"
KEA
_FROM_BUILD"
))
{
setSpecFileName
(
std
::
string
(
getenv
(
"
KEA
_FROM_BUILD"
))
+
"/src/bin/d2/dhcp-ddns.spec"
);
}
else
{
setSpecFileName
(
D2_SPECFILE_LOCATION
);
...
...
src/bin/d2/tests/dns_client_unittests.cc
View file @
aba37777
...
...
@@ -320,7 +320,7 @@ public:
/// instantly. However, it may lead to situations that the message sent
/// in one test will not be dropped by the kernel by the time, the next
/// test starts. This will lead to intermittent unit test errors as
/// described in the ticket http://
bind10
.isc.org/ticket/3265.
/// described in the ticket http://
kea
.isc.org/ticket/3265.
/// Increasing the timeout to a non-zero value mitigates this problem.
/// The proper way to solve this problem is to receive the packet
/// on our own and drop it. Such a fix will need to be applied not only
...
...
src/bin/dhcp4/bundy_controller.cc
View file @
aba37777
...
...
@@ -139,8 +139,8 @@ void ControlledDhcpv4Srv::init(const std::string& config_file) {
Daemon
::
init
(
config_file
);
string
specfile
;
if
(
getenv
(
"
B10
_FROM_BUILD"
))
{
specfile
=
string
(
getenv
(
"
B10
_FROM_BUILD"
))
+
if
(
getenv
(
"
KEA
_FROM_BUILD"
))
{
specfile
=
string
(
getenv
(
"
KEA
_FROM_BUILD"
))
+
"/src/bin/dhcp4/dhcp4.spec"
;
}
else
{
specfile
=
string
(
DHCP4_SPECFILE_LOCATION
);
...
...
src/bin/dhcp4/kea_controller.cc
View file @
aba37777
...
...
@@ -172,11 +172,11 @@ void ControlledDhcpv4Srv::cleanup() {
/// @todo: Implement this properly (see #3427)
void
Daemon
::
loggerInit
(
const
char
*
,
bool
verbose
)
{
setenv
(
"
B10
_LOCKFILE_DIR_FROM_BUILD"
,
"/tmp"
,
1
);
setenv
(
"
B10
_LOGGER_ROOT"
,
"kea"
,
0
);
setenv
(
"
B10
_LOGGER_SEVERITY"
,
(
verbose
?
"DEBUG"
:
"INFO"
),
0
);
setenv
(
"
B10
_LOGGER_DBGLEVEL"
,
"99"
,
0
);
setenv
(
"
B10
_LOGGER_DESTINATION"
,
"stdout"
,
0
);
setenv
(
"
KEA
_LOCKFILE_DIR_FROM_BUILD"
,
"/tmp"
,
1
);
setenv
(
"
KEA
_LOGGER_ROOT"
,
"kea"
,
0
);
setenv
(
"
KEA
_LOGGER_SEVERITY"
,
(
verbose
?
"DEBUG"
:
"INFO"
),
0
);
setenv
(
"
KEA
_LOGGER_DBGLEVEL"
,
"99"
,
0
);
setenv
(
"
KEA
_LOGGER_DESTINATION"
,
"stdout"
,
0
);
isc
::
log
::
initLogger
();
}
...
...
src/bin/dhcp4/tests/dhcp4_unittests.cc
View file @
aba37777
...
...
@@ -21,7 +21,7 @@ main(int argc, char* argv[]) {
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
// See the documentation of the
B10
_* environment variables in
// See the documentation of the
KEA
_* environment variables in
// src/lib/log/README for info on how to tweak logging
isc
::
log
::
initLogger
();
...
...
src/bin/dhcp6/bundy_controller.cc
View file @
aba37777
...
...
@@ -144,8 +144,8 @@ ControlledDhcpv6Srv::init(const std::string& config_file) {
// configuration from cfgmgr (or indirectly from user via bindctl).
string
specfile
;
if
(
getenv
(
"
B10
_FROM_BUILD"
))
{
specfile
=
string
(
getenv
(
"
B10
_FROM_BUILD"
))
+
if
(
getenv
(
"
KEA
_FROM_BUILD"
))
{
specfile
=
string
(
getenv
(
"
KEA
_FROM_BUILD"
))
+
"/src/bin/dhcp6/dhcp6.spec"
;
}
else
{
specfile
=
string
(
DHCP6_SPECFILE_LOCATION
);
...
...
src/bin/dhcp6/kea_controller.cc
View file @
aba37777
...
...
@@ -174,11 +174,11 @@ void ControlledDhcpv6Srv::cleanup() {
/// @todo: Implement this properly (see #3427)
void
Daemon
::
loggerInit
(
const
char
*
,
bool
verbose
)
{
setenv
(
"
B10
_LOCKFILE_DIR_FROM_BUILD"
,
"/tmp"
,
1
);
setenv
(
"
B10
_LOGGER_ROOT"
,
"kea"
,
0
);
setenv
(
"
B10
_LOGGER_SEVERITY"
,
(
verbose
?
"DEBUG"
:
"INFO"
),
0
);
setenv
(
"
B10
_LOGGER_DBGLEVEL"
,
"99"
,
0
);
setenv
(
"
B10
_LOGGER_DESTINATION"
,
"stdout"
,
0
);
setenv
(
"
KEA
_LOCKFILE_DIR_FROM_BUILD"
,
"/tmp"
,
1
);
setenv
(
"
KEA
_LOGGER_ROOT"
,
"kea"
,
0
);
setenv
(
"
KEA
_LOGGER_SEVERITY"
,
(
verbose
?
"DEBUG"
:
"INFO"
),
0
);
setenv
(
"
KEA
_LOGGER_DBGLEVEL"
,
"99"
,
0
);
setenv
(
"
KEA
_LOGGER_DESTINATION"
,
"stdout"
,
0
);
isc
::
log
::
initLogger
();
}
...
...
src/lib/config/ccsession.cc
View file @
aba37777
...
...
@@ -178,7 +178,7 @@ ConstElementPtr getValueOrDefault(ConstElementPtr config_part,
}
}
/// @brief Prefix name with "
b10
-".
/// @brief Prefix name with "
kea
-".
///
/// In BIND 10, modules had names taken from the .spec file, which are typically
/// names starting with a capital letter (e.g. "Resolver", "Auth" etc.). The
...
...
@@ -190,26 +190,26 @@ ConstElementPtr getValueOrDefault(ConstElementPtr config_part,
/// In Kea we're not using module names, but we do still keep some capability to
/// run Kea servers in Bundy framework. For that reason the whole discussion here
/// applies only to case when Kea is compiled with Bundy configuration backend.
//
// Within the binaries the root loggers are named after the binaries themselves.
// (The reason for this is that the name of the logger is included in the
// message logged, so making it clear which message comes from which Kea
// process.) As logging is configured using module names, the configuration code
// has to match these with the corresponding logger names. This function
// converts a module name to a root logger name by lowercasing the first letter
// of the module name and prepending "
b10
-".
//
// \param instring String to convert. (This may be empty, in which case
// "
b10
-" will be returned.)
//
// \return Converted string.
//
/
//
/
Within the binaries the root loggers are named after the binaries themselves.
//
/
(The reason for this is that the name of the logger is included in the
//
/
message logged, so making it clear which message comes from which Kea
//
/
process.) As logging is configured using module names, the configuration code
//
/
has to match these with the corresponding logger names. This function
//
/
converts a module name to a root logger name by lowercasing the first letter
//
/
of the module name and prepending "
kea
-".
//
/
//
/
\param instring String to convert. (This may be empty, in which case
//
/
"
kea
-" will be returned.)
//
/
//
/
\return Converted string.
std
::
string
b10
Prefix
(
const
std
::
string
&
instring
)
{
kea
Prefix
(
const
std
::
string
&
instring
)
{
std
::
string
result
=
instring
;
if
(
!
result
.
empty
())
{
result
[
0
]
=
tolower
(
result
[
0
]);
}
return
(
std
::
string
(
"
b10
-"
)
+
result
);
return
(
std
::
string
(
"
kea
-"
)
+
result
);
}
// Reads a output_option subelement of a logger configuration,
...
...
@@ -318,16 +318,16 @@ getRelatedLoggers(ConstElementPtr loggers) {
ElementPtr
result
=
isc
::
data
::
Element
::
createList
();
BOOST_FOREACH
(
ConstElementPtr
cur_logger
,
loggers
->
listValue
())
{
// Need to add the
b10
- prefix to names ready from the spec file.
// Need to add the
kea
- prefix to names ready from the spec file.
const
std
::
string
cur_name
=
cur_logger
->
get
(
"name"
)
->
stringValue
();
const
std
::
string
mod_name
=
b10
Prefix
(
cur_name
);
const
std
::
string
mod_name
=
kea
Prefix
(
cur_name
);
if
(
mod_name
==
root_name
||
mod_name
.
find
(
root_name
+
"."
)
==
0
)
{
// Note this name so that we don't add a wildcard that matches it.
our_names
.
insert
(
mod_name
);
// We want to store the logger with the modified name (i.e. with
// the
b10
- prefix). As we are dealing with const loggers, we
// the
kea
- prefix). As we are dealing with const loggers, we
// store a modified copy of the data.
result
->
add
(
copyLogger
(
cur_logger
,
mod_name
));
LOG_DEBUG
(
config_logger
,
DBG_CONFIG_PROCESS
,
CONFIG_LOG_EXPLICIT
)
...
...
src/lib/config/tests/ccsession_unittests.cc
View file @
aba37777
...
...
@@ -1165,8 +1165,8 @@ void doRelatedLoggersTest(const char* input, const char* expected) {
TEST
(
LogConfigTest
,
relatedLoggersTest
)
{
// make sure logger configs for 'other' programs are ignored,
// and that * is substituted correctly
// We'll use a root logger name of "
b10
-test".
isc
::
log
::
setRootLoggerName
(
"
b10
-test"
);
// We'll use a root logger name of "
kea
-test".
isc
::
log
::
setRootLoggerName
(
"
kea
-test"
);
doRelatedLoggersTest
(
"[{
\"
name
\"
:
\"
other_module
\"
}]"
,
"[]"
);
...
...
@@ -1178,30 +1178,30 @@ TEST(LogConfigTest, relatedLoggersTest) {
"[]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
other_module
\"
},"
" {
\"
name
\"
:
\"
test
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
test
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
test.somelib
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test.somelib
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test.somelib
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
other_module.somelib
\"
},"
" {
\"
name
\"
:
\"
test.somelib
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test.somelib
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test.somelib
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
other_module.somelib
\"
},"
" {
\"
name
\"
:
\"
test
\"
},"
" {
\"
name
\"
:
\"
test.somelib
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
},"
" {
\"
name
\"
:
\"
b10
-test.somelib
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test
\"
},"
" {
\"
name
\"
:
\"
kea
-test.somelib
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
*
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
*.somelib
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test.somelib
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test.somelib
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
*
\"
,
\"
severity
\"
:
\"
DEBUG
\"
},"
" {
\"
name
\"
:
\"
test
\"
,
\"
severity
\"
:
\"
WARN
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
,
\"
severity
\"
:
\"
WARN
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test
\"
,
\"
severity
\"
:
\"
WARN
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
*
\"
,
\"
severity
\"
:
\"
DEBUG
\"
},"
" {
\"
name
\"
:
\"
some_module
\"
,
\"
severity
\"
:
\"
WARN
\"
}]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
,
\"
severity
\"
:
\"
DEBUG
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
b10
-test
\"
}]"
,
"[ {
\"
name
\"
:
\"
kea
-test
\"
,
\"
severity
\"
:
\"
DEBUG
\"
} ]"
);
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
kea
-test
\"
}]"
,
"[]"
);
// make sure 'bad' things like '*foo.x' or '*lib' are ignored
// (cfgmgr should have already caught it in the logconfig plugin
...
...
@@ -1213,7 +1213,7 @@ TEST(LogConfigTest, relatedLoggersTest) {
doRelatedLoggersTest
(
"[ {
\"
name
\"
:
\"
*foo
\"
},"
" {
\"
name
\"
:
\"
*foo.lib
\"
},"
" {
\"
name
\"
:
\"
test
\"
} ]"
,
"[ {
\"
name
\"
:
\"
b10
-test
\"
} ]"
);
"[ {
\"
name
\"
:
\"
kea
-test
\"
} ]"
);
}
}
src/lib/dhcp/option6_client_fqdn.cc
View file @
aba37777
...
...
@@ -27,8 +27,8 @@ namespace dhcp {
///
/// The purpose of the class is to separate the implementation details
/// of the Option6ClientFqdn class from the interface. This implementation
/// uses
b10
-libdns classes to process FQDNs. At some point it may be
/// desired to split
b10
-libdhcp++ from
b10
-libdns. In such case the
/// uses
kea
-libdns classes to process FQDNs. At some point it may be
/// desired to split
kea
-libdhcp++ from
kea
-libdns. In such case the
/// implementation of this class may be changed. The declaration of the
/// Option6ClientFqdn class holds the pointer to implementation, so
/// the transition to a different implementation would not affect the
...
...
src/lib/log/interprocess/interprocess_sync_file.cc
View file @
aba37777
...
...
@@ -46,17 +46,17 @@ InterprocessSyncFile::do_lock(int cmd, short l_type) {
if
(
fd_
==
-
1
)
{
std
::
string
lockfile_path
=
LOCKFILE_DIR
;
const
char
*
const
env
=
getenv
(
"
B10
_FROM_BUILD"
);
const
char
*
const
env
=
getenv
(
"
KEA
_FROM_BUILD"
);
if
(
env
!=
NULL
)
{
lockfile_path
=
env
;
}
const
char
*
const
env2
=
getenv
(
"
B10
_FROM_BUILD_LOCALSTATEDIR"
);
const
char
*
const
env2
=
getenv
(
"
KEA
_FROM_BUILD_LOCALSTATEDIR"
);
if
(
env2
!=
NULL
)
{
lockfile_path
=
env2
;
}
const
char
*
const
env3
=
getenv
(
"
B10
_LOCKFILE_DIR_FROM_BUILD"
);
const
char
*
const
env3
=
getenv
(
"
KEA
_LOCKFILE_DIR_FROM_BUILD"
);
if
(
env3
!=
NULL
)
{
lockfile_path
=
env3
;
}
...
...
src/lib/log/interprocess/tests/run_unittests.cc
View file @
aba37777
...
...
@@ -20,6 +20,6 @@ int
main
(
int
argc
,
char
*
argv
[])
{
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
setenv
(
"
B10
_LOCKFILE_DIR_FROM_BUILD"
,
TEST_DATA_TOPBUILDDIR
,
1
);
setenv
(
"
KEA
_LOCKFILE_DIR_FROM_BUILD"
,
TEST_DATA_TOPBUILDDIR
,
1
);
return
(
isc
::
util
::
unittests
::
run_all
());
}
src/lib/log/logger_manager_impl.cc
View file @
aba37777
...
...
@@ -227,16 +227,16 @@ void LoggerManagerImpl::initRootLogger(isc::log::Severity severity,
// Set the level for the Kea root logger to the given severity and
// debug level.
log4cplus
::
Logger
b10
root
=
log4cplus
::
Logger
::
getInstance
(
log4cplus
::
Logger
kea_
root
=
log4cplus
::
Logger
::
getInstance
(
getRootLoggerName
());
b10
root
.
setLogLevel
(
LoggerLevelImpl
::
convertFromBindLevel
(
kea_
root
.
setLogLevel
(
LoggerLevelImpl
::
convertFromBindLevel
(
Level
(
severity
,
dbglevel
)));
if
(
buffer
)
{
createBufferAppender
(
b10
root
);
createBufferAppender
(
kea_
root
);
}
else
{
OutputOption
opt
;
createConsoleAppender
(
b10
root
,
opt
);
createConsoleAppender
(
kea_
root
,
opt
);
}
}
...
...
src/lib/log/logger_unittest_support.cc
View file @
aba37777
...
...
@@ -30,13 +30,13 @@ namespace isc {
namespace
log
{
// Get the logging severity. This is defined by the environment variable
//
B10
_LOGGER_SEVERITY, and can be one of "DEBUG", "INFO", "WARN", "ERROR"
//
KEA
_LOGGER_SEVERITY, and can be one of "DEBUG", "INFO", "WARN", "ERROR"
// of "FATAL". (Note that the string must be in upper case with no leading
// of trailing blanks.) If not present, the default severity passed to the
// function is returned.
isc
::
log
::
Severity
b10
LoggerSeverity
(
isc
::
log
::
Severity
defseverity
)
{
const
char
*
sev_char
=
getenv
(
"
B10
_LOGGER_SEVERITY"
);
kea
LoggerSeverity
(
isc
::
log
::
Severity
defseverity
)
{
const
char
*
sev_char
=
getenv
(
"
KEA
_LOGGER_SEVERITY"
);
if
(
sev_char
)
{
return
(
isc
::
log
::
getSeverity
(
sev_char
));
}
...
...
@@ -44,11 +44,11 @@ b10LoggerSeverity(isc::log::Severity defseverity) {
}
// Get the debug level. This is defined by the environment variable
//
B10
_LOGGER_DBGLEVEL. If not defined, a default value passed to the function
//
KEA
_LOGGER_DBGLEVEL. If not defined, a default value passed to the function
// is returned.
int
b10
LoggerDbglevel
(
int
defdbglevel
)
{
const
char
*
dbg_char
=
getenv
(
"
B10
_LOGGER_DBGLEVEL"
);
kea
LoggerDbglevel
(
int
defdbglevel
)
{
const
char
*
dbg_char
=
getenv
(
"
KEA
_LOGGER_DBGLEVEL"
);
if
(
dbg_char
)
{
int
level
=
0
;
try
{
...
...
@@ -67,7 +67,7 @@ b10LoggerDbglevel(int defdbglevel) {
}
catch
(...)
{
// Error, but not fatal to the test
std
::
cerr
<<
"**ERROR** Unable to translate "
"
B10
_LOGGER_DBGLEVEL - a value of 0 will be used
\n
"
;
"
KEA
_LOGGER_DBGLEVEL - a value of 0 will be used
\n
"
;
}
return
(
level
);
}
...
...
@@ -77,7 +77,7 @@ b10LoggerDbglevel(int defdbglevel) {
// Reset characteristics of the root logger to that set by the environment
// variables
B10
_LOGGER_SEVERITY,
B10
_LOGGER_DBGLEVEL and
B10
_LOGGER_DESTINATION.
// variables
KEA
_LOGGER_SEVERITY,
KEA
_LOGGER_DBGLEVEL and
KEA
_LOGGER_DESTINATION.
void
resetUnitTestRootLogger
()
{
...
...
@@ -96,13 +96,13 @@ resetUnitTestRootLogger() {
// severity for unit tests is DEBUG, which generates a lot of output.
// Routing the logging to /dev/null will suppress that, whilst still
// ensuring that the code paths are tested.)
const
char
*
destination
=
getenv
(
"
B10
_LOGGER_DESTINATION"
);
const
char
*
destination
=
getenv
(
"
KEA
_LOGGER_DESTINATION"
);
const
string
dest
((
destination
==
NULL
)
?
DEVNULL
:
destination
);
// Prepare the objects to define the logging specification
LoggerSpecification
spec
(
getRootLoggerName
(),
b10
LoggerSeverity
(
isc
::
log
::
DEBUG
),
b10
LoggerDbglevel
(
isc
::
log
::
MAX_DEBUG_LEVEL
));
kea
LoggerSeverity
(
isc
::
log
::
DEBUG
),
kea
LoggerDbglevel
(
isc
::
log
::
MAX_DEBUG_LEVEL
));
OutputOption
option
;
// Set up output option according to destination specification
...
...
@@ -123,7 +123,7 @@ resetUnitTestRootLogger() {
option
.
destination
=
OutputOption
::
DEST_SYSLOG
;
// Must take account of the string actually being "syslog:"
if
(
dest
==
SYSLOG_COLON
)
{
cerr
<<
"**ERROR** value for
B10
_LOGGER_DESTINATION of "
<<
cerr
<<
"**ERROR** value for
KEA
_LOGGER_DESTINATION of "
<<
SYSLOG_COLON
<<
" is invalid, "
<<
SYSLOG
<<
" will be used instead
\n
"
;
// Use default for logging facility
...
...
@@ -149,7 +149,7 @@ resetUnitTestRootLogger() {
// Logger Run-Time Initialization via Environment Variables
void
initLogger
(
isc
::
log
::
Severity
severity
,
int
dbglevel
)
{
// Root logger name is defined by the environment variable
B10
_LOGGER_ROOT.
// Root logger name is defined by the environment variable
KEA
_LOGGER_ROOT.
// If not present, the name is "kea".
const
char
*
DEFAULT_ROOT
=
"kea"
;
const
char
*
root
=
getenv
(
"KEA_LOGGER_ROOT"
);
...
...
@@ -158,10 +158,10 @@ void initLogger(isc::log::Severity severity, int dbglevel) {
}
// Set the local message file
const
char
*
localfile
=
getenv
(
"
B10
_LOGGER_LOCALMSG"
);
const
char
*
localfile
=
getenv
(
"
KEA
_LOGGER_LOCALMSG"
);
// Set a directory for creating lockfiles when running tests
setenv
(
"
B10
_LOCKFILE_DIR_FROM_BUILD"
,
TOP_BUILDDIR
,
1
);
setenv
(
"
KEA
_LOCKFILE_DIR_FROM_BUILD"
,
TOP_BUILDDIR
,
1
);
// Initialize logging
initLogger
(
root
,
isc
::
log
::
DEBUG
,
isc
::
log
::
MAX_DEBUG_LEVEL
,
localfile
);
...
...
src/lib/log/logger_unittest_support.h
View file @
aba37777
...
...
@@ -33,27 +33,27 @@ namespace log {
/// Performs run-time initialization of the logger via the setting of
/// environment variables. These are:
///
/// -
B10
_LOGGER_ROOT\n
/// -
KEA
_LOGGER_ROOT\n
/// Name of the root logger. If not given, the string "kea" will be used.
///
/// -
B10
_LOGGER_SEVERITY\n
/// -
KEA
_LOGGER_SEVERITY\n
/// Severity of messages that will be logged. This must be one of the strings
/// "DEBUG", "INFO", "WARN", "ERROR", "FATAL" or "NONE". (Must be upper case
/// and must not contain leading or trailing spaces.) If not specified (or if
/// specified but incorrect), the default passed as argument to this function
/// (currently DEBUG) will be used.
///
/// -
B10
_LOGGER_DBGLEVEL\n
/// -
KEA
_LOGGER_DBGLEVEL\n
/// Ignored if the level is not DEBUG, this should be a number between 0 and
/// 99 indicating the logging severity. The default is 0. If outside these
/// limits or if not a number, The value passed to this function (default
/// of MAX_DEBUG_LEVEL) is used.
///
/// -
B10
_LOGGER_LOCALMSG\n
/// -
KEA
_LOGGER_LOCALMSG\n
/// If defined, the path specification of a file that contains message
/// definitions replacing ones in the default dictionary.
///
/// -
B10
_LOGGER_DESTINATION\n
/// -
KEA
_LOGGER_DESTINATION\n
/// If defined, the destination of the logging output. This can be one of:
/// - \c stdout Send output to stdout.
/// - \c stderr Send output to stderr
...
...
@@ -70,29 +70,29 @@ namespace log {
/// be overridden by the tester. It is not intended for use in production
/// code.
///
///
TODO
: Rename. This function overloads the initLogger() function that can
///
@todo
: Rename. This function overloads the initLogger() function that can
/// be used to initialize production programs. This may lead to confusion.
void
initLogger
(
isc
::
log
::
Severity
severity
=
isc
::
log
::
DEBUG
,
int
dbglevel
=
isc
::
log
::
MAX_DEBUG_LEVEL
);
/// \brief Obtains logging severity from
B10
_LOGGER_SEVERITY
/// \brief Obtains logging severity from
KEA
_LOGGER_SEVERITY
///
/// Support function called by the unit test logging initialization code.
/// It returns the logging severity defined by
B10
_LOGGER_SEVERITY. If
/// It returns the logging severity defined by
KEA
_LOGGER_SEVERITY. If
/// not defined it returns the default passed to it.
///
/// \param defseverity Default severity used if
B10
_LOGGER_SEVERITY is not
/// \param defseverity Default severity used if
KEA
_LOGGER_SEVERITY is not
// defined.
///
/// \return Severity to use for the logging.
isc
::
log
::
Severity
b10
LoggerSeverity
(
isc
::
log
::
Severity
defseverity
);
isc
::
log
::
Severity
kea
LoggerSeverity
(
isc
::
log
::
Severity
defseverity
);
/// \brief Obtains logging debug level from
B10
_LOGGER_DBGLEVEL
/// \brief Obtains logging debug level from
KEA
_LOGGER_DBGLEVEL
///
/// Support function called by the unit test logging initialization code.
/// It returns the logging debug level defined by
B10
_LOGGER_DBGLEVEL. If
/// It returns the logging debug level defined by
KEA
_LOGGER_DBGLEVEL. If
/// not defined, it returns the default passed to it.
///
/// N.B. If there is an error, a message is written to stderr and a value
...
...
@@ -101,11 +101,11 @@ isc::log::Severity b10LoggerSeverity(isc::log::Severity defseverity);
/// function is only used in unit test logging initialization, so incorrect
/// selection of a level is not really an issue.)
///
/// \param defdbglevel Default debug level to be used if
B10
_LOGGER_DBGLEVEL
/// \param defdbglevel Default debug level to be used if
KEA
_LOGGER_DBGLEVEL
/// is not defined.
///
/// \return Debug level to use.
int
b10
LoggerDbglevel
(
int
defdbglevel
);
int
kea
LoggerDbglevel
(
int
defdbglevel
);
/// \brief Reset root logger characteristics
...
...
@@ -113,8 +113,8 @@ int b10LoggerDbglevel(int defdbglevel);
/// This is a simplified interface into the resetting of the characteristics
/// of the root logger. It is aimed for use in unit tests and resets the
/// characteristics of the root logger to use a severity, debug level and
/// destination set by the environment variables
B10
_LOGGER_SEVERITY,
///
B10
_LOGGER_DBGLEVEL and
B10
_LOGGER_DESTINATION.
/// destination set by the environment variables
KEA
_LOGGER_SEVERITY,
///
KEA
_LOGGER_DBGLEVEL and
KEA
_LOGGER_DESTINATION.
void
resetUnitTestRootLogger
();
...
...
src/lib/util/threads/sync.h
View file @
aba37777
...
...
@@ -12,8 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#ifndef
B10
_THREAD_SYNC_H
#define
B10
_THREAD_SYNC_H
#ifndef
KEA
_THREAD_SYNC_H
#define
KEA
_THREAD_SYNC_H
#include
<exceptions/exceptions.h>
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment