Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
senf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wiback
senf
Commits
17381440
Commit
17381440
authored
17 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
Utils/Logger; Small documentation fix
Utils: Catch exceptions in senf::Daemin in non-debug build
parent
81653a87
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Utils/DaemonTools.cc
+22
-0
22 additions, 0 deletions
Utils/DaemonTools.cc
Utils/Logger/Config.hh
+6
-5
6 additions, 5 deletions
Utils/Logger/Config.hh
with
28 additions
and
5 deletions
Utils/DaemonTools.cc
+
22
−
0
View file @
17381440
...
...
@@ -87,12 +87,29 @@ prefix_ int senf::Daemon::start(int argc, char const ** argv)
argc_
=
argc
;
argv_
=
argv
;
# ifdef NDEBUG
try
{
# endif
configure
();
if
(
daemonize_
)
fork
();
if
(
!
pidfile_
.
empty
())
pidfileCreate
();
main
();
# ifdef NDEBUG
}
catch
(
std
::
exception
&
e
)
{
std
::
cerr
<<
"
\n
*** Fatal exception: "
<<
e
.
what
()
<<
std
::
endl
;
return
1
;
}
catch
(...)
{
std
::
cerr
<<
"
\n
*** Fatal exception: (unknown)"
<<
std
::
endl
;
return
1
;
}
# endif
return
0
;
}
...
...
@@ -123,6 +140,11 @@ prefix_ void senf::Daemon::init()
prefix_
void
senf
::
Daemon
::
run
()
{}
prefix_
void
senf
::
Daemon
::
fork
()
{
}
prefix_
void
senf
::
Daemon
::
pidfileCreate
()
{}
...
...
This diff is collapsed.
Click to expand it.
Utils/Logger/Config.hh
+
6
−
5
View file @
17381440
...
...
@@ -71,7 +71,7 @@
The runtime configuration is performed by routing messages to one or more logging targets:
\code
senf::log::ConsoleLog consoleLog;
senf::log::ConsoleLog
&
consoleLog
(senf::log::ConsoleLog::instance())
;
senf::log::FileLog fileLog ("my.log");
consoleLog.route<senf::log::Debug>();
...
...
@@ -79,10 +79,11 @@
consoleLog.route<foo::Transactions, senf::log::IMPORTANT>();
fileLog.route<foo::Transactions>();
\endcode Here we see an already relatively complex setup: All debug messages (that is, those,
which are not disabled at compile time) are routed to the console. We also route important
transactions to the console \e except transactions from the \c foo::SomeClass area. The \c
fileLog simply receives all transaction log messages.
\endcode
Here we see an already relatively complex setup: All debug messages (that is, those, which are
not disabled at compile time) are routed to the console. We also route important transactions to
the console \e except transactions from the \c foo::SomeClass area. The \c fileLog simply
receives all transaction log messages.
The routing statements are processed by the targets in order, the first matching rule will
decide a log messages fate for that target.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment