Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
8e61395e
Commit
8e61395e
authored
Sep 25, 2014
by
Tomek Mrugalski
🛰
Browse files
[master] Removed obsolete funtion
parent
93e45f80
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/logging.cc
View file @
8e61395e
...
...
@@ -150,72 +150,5 @@ void LogConfigParser::parseOutputOptions(std::vector<LoggingDestination>& destin
}
}
void
LogConfigParser
::
applyConfiguration
()
{
static
const
std
::
string
STDOUT
=
"stdout"
;
static
const
std
::
string
STDERR
=
"stderr"
;
static
const
std
::
string
SYSLOG
=
"syslog"
;
static
const
std
::
string
SYSLOG_COLON
=
"syslog:"
;
std
::
vector
<
LoggerSpecification
>
specs
;
// Now iterate through all specified loggers
const
LoggingInfoStorage
&
logging_info
=
config_
->
getLoggingInfo
();
for
(
LoggingInfoStorage
::
const_iterator
it
=
logging_info
.
begin
();
it
!=
logging_info
.
end
();
++
it
)
{
// Prepare the objects to define the logging specification
LoggerSpecification
spec
(
it
->
name_
,
it
->
severity_
,
it
->
debuglevel_
);
OutputOption
option
;
for
(
std
::
vector
<
LoggingDestination
>::
const_iterator
dest
=
it
->
destinations_
.
begin
();
dest
!=
it
->
destinations_
.
end
();
++
dest
)
{
// Set up output option according to destination specification
if
(
dest
->
output_
==
STDOUT
)
{
option
.
destination
=
OutputOption
::
DEST_CONSOLE
;
option
.
stream
=
OutputOption
::
STR_STDOUT
;
}
else
if
(
dest
->
output_
==
STDERR
)
{
option
.
destination
=
OutputOption
::
DEST_CONSOLE
;
option
.
stream
=
OutputOption
::
STR_STDERR
;
}
else
if
(
dest
->
output_
==
SYSLOG
)
{
option
.
destination
=
OutputOption
::
DEST_SYSLOG
;
// Use default specified in OutputOption constructor for the
// syslog destination
}
else
if
(
dest
->
output_
.
find
(
SYSLOG_COLON
)
==
0
)
{
option
.
destination
=
OutputOption
::
DEST_SYSLOG
;
// Must take account of the string actually being "syslog:"
if
(
dest
->
output_
==
SYSLOG_COLON
)
{
// The expected syntax is syslog:facility. User skipped
// the logging name, so we'll just use the default ("kea")
option
.
facility
=
isc
::
log
::
getDefaultRootLoggerName
();
}
else
{
// Everything else in the string is the facility name
option
.
facility
=
dest
->
output_
.
substr
(
SYSLOG_COLON
.
size
());
}
}
else
{
// Not a recognised destination, assume a file.
option
.
destination
=
OutputOption
::
DEST_FILE
;
option
.
filename
=
dest
->
output_
;
}
// ... and set the destination
spec
.
addOutputOption
(
option
);
}
specs
.
push_back
(
spec
);
}
LoggerManager
manager
;
manager
.
process
(
specs
.
begin
(),
specs
.
end
());
}
}
// namespace isc::dhcp
}
// namespace isc
src/lib/dhcpsrv/logging.h
View file @
8e61395e
...
...
@@ -64,9 +64,6 @@ public:
void
parseConfiguration
(
const
isc
::
data
::
ConstElementPtr
&
log_config
,
bool
verbose
=
false
);
/// @brief Applies stored configuration
void
applyConfiguration
();
private:
/// @brief Parses one JSON structure in Logging/loggers" array
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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