Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
0544b9aa
Commit
0544b9aa
authored
Feb 25, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added set_all_logging_headers()
parent
2a224bf0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
15 deletions
+51
-15
logger_kernel_1.cpp
dlib/logger/logger_kernel_1.cpp
+16
-1
logger_kernel_1.h
dlib/logger/logger_kernel_1.h
+15
-7
logger_kernel_abstract.h
dlib/logger/logger_kernel_abstract.h
+20
-7
No files found.
dlib/logger/logger_kernel_1.cpp
View file @
0544b9aa
...
...
@@ -47,6 +47,21 @@ namespace dlib
gd
.
set_level
(
""
,
new_level
);
}
void
set_all_logging_headers
(
const
print_header_type
&
new_header
)
{
logger
::
global_data
&
gd
=
logger
::
get_global_data
();
auto_mutex
M
(
gd
.
m
);
gd
.
loggers
.
reset
();
while
(
gd
.
loggers
.
move_next
())
{
gd
.
loggers
.
element
()
->
print_header
=
new_header
;
}
gd
.
set_logger_header
(
""
,
new_header
);
}
// ----------------------------------------------------------------------------------------
namespace
logger_helper_stuff
...
...
@@ -300,7 +315,7 @@ namespace dlib
// ----------------------------------------------------------------------------------------
logger
::
print_header_type
logger
::
global_data
::
print_header_type
logger
::
global_data
::
logger_header
(
const
std
::
string
&
name
)
...
...
dlib/logger/logger_kernel_1.h
View file @
0544b9aa
...
...
@@ -70,6 +70,17 @@ namespace dlib
const
log_level
&
new_level
);
typedef
void
(
*
print_header_type
)(
std
::
ostream
&
out
,
const
std
::
string
&
logger_name
,
const
log_level
&
l
,
const
uint64
thread_id
);
void
set_all_logging_headers
(
const
print_header_type
&
new_header
);
// ----------------------------------------------------------------------------------------
void
print_default_logger_header
(
...
...
@@ -352,13 +363,6 @@ namespace dlib
gd
.
set_output_hook
(
logger_name
,
hook
);
}
typedef
void
(
*
print_header_type
)(
std
::
ostream
&
out
,
const
std
::
string
&
logger_name
,
const
log_level
&
l
,
const
uint64
thread_id
);
print_header_type
logger_header
(
)
const
{
return
print_header
;
}
...
...
@@ -602,6 +606,10 @@ namespace dlib
const
log_level
&
new_level
);
friend
void
set_all_logging_headers
(
const
print_header_type
&
new_header
);
friend
void
set_all_logging_output_streams
(
std
::
ostream
&
out
);
...
...
dlib/logger/logger_kernel_abstract.h
View file @
0544b9aa
...
...
@@ -79,6 +79,26 @@ namespace dlib
- std::bad_alloc
!*/
// ----------------------------------------------------------------------------------------
typedef
void
(
*
print_header_type
)(
std
::
ostream
&
out
,
const
std
::
string
&
logger_name
,
const
log_level
&
l
,
const
uint64
thread_id
);
void
set_all_logging_headers
(
const
print_header_type
&
new_header
);
/*!
ensures
- for all loggers L (even loggers not yet constructed):
- #L.logger_header() == new_header
throws
- std::bad_alloc
!*/
// ----------------------------------------------------------------------------------------
template
<
...
...
@@ -361,13 +381,6 @@ namespace dlib
- std::bad_alloc
!*/
typedef
void
(
*
print_header_type
)(
std
::
ostream
&
out
,
const
std
::
string
&
logger_name
,
const
log_level
&
l
,
const
uint64
thread_id
);
print_header_type
logger_header
(
)
const
;
/*!
...
...
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