Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
d45fc34c
Commit
d45fc34c
authored
May 09, 2015
by
Gabi Melman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #90 from divaykin/sink-flush
explicit flush()
parents
06e0b038
63e0012e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
2 deletions
+30
-2
file_helper.h
include/spdlog/details/file_helper.h
+4
-0
logger_impl.h
include/spdlog/details/logger_impl.h
+6
-1
logger.h
include/spdlog/logger.h
+1
-0
base_sink.h
include/spdlog/sinks/base_sink.h
+0
-1
file_sinks.h
include/spdlog/sinks/file_sinks.h
+8
-0
null_sink.h
include/spdlog/sinks/null_sink.h
+3
-0
ostream_sink.h
include/spdlog/sinks/ostream_sink.h
+5
-0
sink.h
include/spdlog/sinks/sink.h
+1
-0
syslog_sink.h
include/spdlog/sinks/syslog_sink.h
+2
-0
No files found.
include/spdlog/details/file_helper.h
View file @
d45fc34c
...
...
@@ -87,6 +87,10 @@ public:
}
void
flush
()
{
std
::
fflush
(
_fd
);
}
void
close
()
{
if
(
_fd
)
...
...
include/spdlog/details/logger_impl.h
View file @
d45fc34c
...
...
@@ -312,4 +312,8 @@ inline void spdlog::logger::_set_formatter(formatter_ptr msg_formatter)
_formatter
=
msg_formatter
;
}
inline
void
spdlog
::
logger
::
flush
()
{
for
(
auto
&
sink
:
_sinks
)
{
sink
->
flush
();
}
}
\ No newline at end of file
include/spdlog/logger.h
View file @
d45fc34c
...
...
@@ -107,6 +107,7 @@ public:
void
set_pattern
(
const
std
::
string
&
);
void
set_formatter
(
formatter_ptr
);
void
flush
();
protected
:
virtual
void
_log_msg
(
details
::
log_msg
&
);
...
...
include/spdlog/sinks/base_sink.h
View file @
d45fc34c
...
...
@@ -58,7 +58,6 @@ public:
_sink_it
(
msg
);
}
protected
:
virtual
void
_sink_it
(
const
details
::
log_msg
&
msg
)
=
0
;
Mutex
_mutex
;
...
...
include/spdlog/sinks/file_sinks.h
View file @
d45fc34c
...
...
@@ -80,6 +80,10 @@ public:
_file_helper
.
open
(
calc_filename
(
_base_filename
,
0
,
_extension
));
}
virtual
void
flush
()
override
{
_file_helper
.
flush
();
}
protected
:
void
_sink_it
(
const
details
::
log_msg
&
msg
)
override
{
...
...
@@ -167,6 +171,10 @@ public:
_file_helper
.
open
(
calc_filename
(
_base_filename
,
_extension
));
}
virtual
void
flush
()
override
{
_file_helper
.
flush
();
}
protected
:
void
_sink_it
(
const
details
::
log_msg
&
msg
)
override
{
...
...
include/spdlog/sinks/null_sink.h
View file @
d45fc34c
...
...
@@ -40,6 +40,9 @@ protected:
void
_sink_it
(
const
details
::
log_msg
&
)
override
{}
void
flush
()
override
{}
};
typedef
null_sink
<
details
::
null_mutex
>
null_sink_st
;
typedef
null_sink
<
std
::
mutex
>
null_sink_mt
;
...
...
include/spdlog/sinks/ostream_sink.h
View file @
d45fc34c
...
...
@@ -51,6 +51,11 @@ protected:
if
(
_force_flush
)
_ostream
.
flush
();
}
virtual
void
flush
()
override
{
_ostream
.
flush
();
}
std
::
ostream
&
_ostream
;
bool
_force_flush
;
};
...
...
include/spdlog/sinks/sink.h
View file @
d45fc34c
...
...
@@ -35,6 +35,7 @@ class sink
public
:
virtual
~
sink
()
{}
virtual
void
log
(
const
details
::
log_msg
&
msg
)
=
0
;
virtual
void
flush
()
=
0
;
};
}
}
...
...
include/spdlog/sinks/syslog_sink.h
View file @
d45fc34c
...
...
@@ -78,6 +78,8 @@ public:
::
syslog
(
syslog_prio_from_level
(
msg
),
"%s"
,
msg
.
formatted
.
str
().
c_str
());
}
virtual
void
flush
()
override
{
}
private
:
...
...
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