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
ff55b029
Commit
ff55b029
authored
Apr 26, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just a few minor overloads and usability tweaks to the logger interface.
parent
69e5340c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
logger_kernel_1.h
dlib/logger/logger_kernel_1.h
+21
-0
logger_kernel_abstract.h
dlib/logger/logger_kernel_abstract.h
+23
-0
No files found.
dlib/logger/logger_kernel_1.h
View file @
ff55b029
...
...
@@ -36,10 +36,21 @@ namespace dlib
name
[
19
]
=
'\0'
;
}
bool
operator
<
(
const
log_level
&
rhs
)
const
{
return
priority
<
rhs
.
priority
;
}
bool
operator
<=
(
const
log_level
&
rhs
)
const
{
return
priority
<=
rhs
.
priority
;
}
bool
operator
>
(
const
log_level
&
rhs
)
const
{
return
priority
>
rhs
.
priority
;
}
bool
operator
>=
(
const
log_level
&
rhs
)
const
{
return
priority
>=
rhs
.
priority
;
}
int
priority
;
char
name
[
20
];
};
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
log_level
&
item
)
{
out
<<
item
.
name
;
return
out
;
}
const
log_level
LALL
(
std
::
numeric_limits
<
int
>::
min
(),
"ALL"
);
const
log_level
LNONE
(
std
::
numeric_limits
<
int
>::
max
(),
"NONE"
);
const
log_level
LTRACE
(
-
100
,
"TRACE"
);
...
...
@@ -79,6 +90,16 @@ namespace dlib
const
char
*
message_to_log
)
);
template
<
typename
T
>
void
set_all_logging_output_hooks
(
T
&
object
)
{
set_all_logging_output_hooks
(
object
,
&
T
::
log
);
}
// ----------------------------------------------------------------------------------------
class
logger
...
...
dlib/logger/logger_kernel_abstract.h
View file @
ff55b029
...
...
@@ -35,10 +35,22 @@ namespace dlib
is null terminated.
!*/
bool
operator
<
(
const
log_level
&
rhs
)
const
{
return
priority
<
rhs
.
priority
;
}
bool
operator
<=
(
const
log_level
&
rhs
)
const
{
return
priority
<=
rhs
.
priority
;
}
bool
operator
>
(
const
log_level
&
rhs
)
const
{
return
priority
>
rhs
.
priority
;
}
bool
operator
>=
(
const
log_level
&
rhs
)
const
{
return
priority
>=
rhs
.
priority
;
}
int
priority
;
char
name
[
20
];
};
inline
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
log_level
&
item
);
/*!
ensures
- performs out << item.name
- returns out
!*/
// ----------------------------------------------------------------------------------------
const
log_level
LALL
(
std
::
numeric_limits
<
int
>::
min
(),
"ALL"
);
...
...
@@ -89,6 +101,17 @@ namespace dlib
- std::bad_alloc
!*/
template
<
typename
T
>
void
set_all_logging_output_hooks
(
T
&
object
);
/*!
ensures
- calls set_all_logging_output_hooks(object, &T::log);
!*/
// ----------------------------------------------------------------------------------------
void
set_all_logging_levels
(
...
...
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