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
6198e28c
Commit
6198e28c
authored
16 years ago
by
g0dil
Browse files
Options
Downloads
Patches
Plain Diff
Utils/Logger: Implement areas and streams commands
parent
aa485bb3
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/Logger/Target.cc
+26
-2
26 additions, 2 deletions
Utils/Logger/Target.cc
Utils/Logger/Target.ih
+3
-0
3 additions, 0 deletions
Utils/Logger/Target.ih
with
29 additions
and
2 deletions
Utils/Logger/Target.cc
+
26
−
2
View file @
6198e28c
...
...
@@ -88,9 +88,13 @@ prefix_ senf::log::Target::Target(std::string const & name)
std
::
string
const
&
,
std
::
string
const
&
,
unsigned
,
action_t
,
int
)
>
(
&
Target
::
route
),
this
)))
.
arg
(
"stream"
,
"stream to match or empty to match any stream"
,
.
arg
(
"stream"
,
"stream to match or empty to match any stream
\n
"
" use '/sys/log/streams' to list all available streams"
,
kw
::
default_value
=
""
)
.
arg
(
"area"
,
"area to match or empty to match any area"
,
.
arg
(
"area"
,
"area to match or empty to match any area
\n
"
" use '/sys/log/areas' to list all available areas"
,
kw
::
default_value
=
""
)
.
arg
(
"level"
,
"log level, one of: VERBOSE, NOTICE, MESSAGE, IMPORTANT, CRITICAL, FATAL"
,
kw
::
default_value
=
local
::
VERBOSE
)
...
...
@@ -237,6 +241,26 @@ prefix_ senf::log::detail::TargetRegistry::TargetRegistry()
:
fallbackRouting_
(
true
)
{
console
::
sysdir
().
add
(
"log"
,
consoleDir_
());
consoleDir_
().
add
(
"areas"
,
senf
::
membind
(
&
TargetRegistry
::
consoleAreas
,
this
))
.
doc
(
"List all areas"
);
consoleDir_
().
add
(
"streams"
,
senf
::
membind
(
&
TargetRegistry
::
consoleStreams
,
this
))
.
doc
(
"List all streams"
);
}
prefix_
void
senf
::
log
::
detail
::
TargetRegistry
::
consoleAreas
(
std
::
ostream
&
os
)
{
AreaRegistry
::
iterator
i
(
AreaRegistry
::
instance
().
begin
());
AreaRegistry
::
iterator
const
i_end
(
AreaRegistry
::
instance
().
end
());
for
(;
i
!=
i_end
;
++
i
)
os
<<
*
i
<<
"
\n
"
;
}
prefix_
void
senf
::
log
::
detail
::
TargetRegistry
::
consoleStreams
(
std
::
ostream
&
os
)
{
StreamRegistry
::
iterator
i
(
StreamRegistry
::
instance
().
begin
());
StreamRegistry
::
iterator
const
i_end
(
StreamRegistry
::
instance
().
end
());
for
(;
i
!=
i_end
;
++
i
)
os
<<
*
i
<<
"
\n
"
;
}
////////////////////////////////////////
...
...
This diff is collapsed.
Click to expand it.
Utils/Logger/Target.ih
+
3
−
0
View file @
6198e28c
...
...
@@ -57,6 +57,9 @@ namespace detail {
void registerTarget(Target * target, std::string const & name);
void unregisterTarget(Target * target);
void consoleAreas(std::ostream & os);
void consoleStreams(std::ostream & os);
typedef std::set<Target *> Targets;
Targets targets_;
...
...
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