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
4ed60bef
Commit
4ed60bef
authored
Mar 22, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fixes
parent
8d83c0b2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
13 deletions
+16
-13
example.cpp
example/example.cpp
+2
-2
fast_buf.h
include/c11log/details/fast_buf.h
+4
-1
fast_oss.h
include/c11log/details/fast_oss.h
+6
-6
line_logger.h
include/c11log/details/line_logger.h
+4
-4
No files found.
example/example.cpp
View file @
4ed60bef
...
...
@@ -19,7 +19,7 @@ int main(int argc, char* argv[])
{
if
(
argc
||
argv
)
{};
const
unsigned
int
howmany
=
1000000
;
const
unsigned
int
howmany
=
1000000
;
auto
fsink
=
std
::
make_shared
<
sinks
::
rotating_file_sink
>
(
"log"
,
"txt"
,
1024
*
1024
*
50
,
5
,
0
);
//auto fsink = std::make_shared<sinks::simple_file_sink>("simplelog", "txt");
...
...
@@ -27,7 +27,7 @@ int main(int argc, char* argv[])
logger
cout_logger
(
"cout"
,
{
null_sink
,
sinks
::
stdout_sink
()});
cout_logger
.
info
()
<<
"Hello cout logger!"
;
cout_logger
.
info
()
<<
"Hello cout logger!"
;
logger
my_logger
(
"my_logger"
,
{
null_sink
});
...
...
include/c11log/details/fast_buf.h
View file @
4ed60bef
...
...
@@ -9,7 +9,10 @@
// stores its contents on the stack when possible, in vector<char> otherwise
// NOTE: User should be remember that returned buffer might be on the stack!!
namespace
c11log
{
namespace
details
{
namespace
c11log
{
namespace
details
{
template
<
std
::
size_t
STACK_SIZE
=
128
>
class
fast_buf
...
...
include/c11log/details/fast_oss.h
View file @
4ed60bef
...
...
@@ -19,14 +19,14 @@ public:
str_devicebuf
(
str_devicebuf
&&
other
)
=
delete
;
str_devicebuf
&
operator
=
(
const
str_devicebuf
&
)
=
delete
;
str_devicebuf
&
operator
=
(
str_devicebuf
&&
)
=
delete
;
bufpair_t
buf
()
{
return
_fastbuf
.
get
();
}
void
reset_st
r
()
{
void
clea
r
()
{
_fastbuf
.
clear
();
}
...
...
@@ -39,7 +39,7 @@ protected:
// copy the give buffer into the accumulated string.
// reserve initially 128 bytes which should be enough for common log lines
std
::
streamsize
xsputn
(
const
char_type
*
s
,
std
::
streamsize
count
)
override
{
{
_fastbuf
.
append
(
s
,
static_cast
<
unsigned
int
>
(
count
));
return
count
;
}
...
...
@@ -73,9 +73,9 @@ public:
return
_dev
.
buf
();
}
void
reset_st
r
()
void
clea
r
()
{
_dev
.
reset_st
r
();
_dev
.
clea
r
();
}
private
:
...
...
include/c11log/details/line_logger.h
View file @
4ed60bef
...
...
@@ -38,13 +38,13 @@ public:
line_logger
&
operator
=
(
const
line_logger
&
)
=
delete
;
line_logger
&
operator
=
(
line_logger
&&
)
=
delete
;
// The move ctor should only be called on start of logging line,
// where no logging happened yet for this line so no need to copy the string from the other
// The move ctor should only be called on start of logging line,
// where no logging happened yet for this line so no need to copy the string from the other
line_logger
(
line_logger
&&
other
)
:
_callback_logger
(
other
.
_callback_logger
),
_callback_logger
(
other
.
_callback_logger
),
_oss
(),
_level
(
other
.
_level
),
_enabled
(
other
.
_enabled
)
{}
_enabled
(
other
.
_enabled
)
{}
~
line_logger
()
...
...
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