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
ef330729
Commit
ef330729
authored
Oct 14, 2014
by
gabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved pattern_formatter to details
parent
001f5727
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
21 deletions
+21
-21
c11logtest.vcxproj
c11logtest/c11logtest/c11logtest.vcxproj
+2
-2
c11logtest.vcxproj.filters
c11logtest/c11logtest/c11logtest.vcxproj.filters
+5
-5
bench.cpp
example/bench.cpp
+2
-2
pattern_formatter.h
include/c11log/details/pattern_formatter.h
+11
-11
logger.h
include/c11log/logger.h
+1
-1
No files found.
c11logtest/c11logtest/c11logtest.vcxproj
View file @
ef330729
...
...
@@ -94,17 +94,17 @@
<ClInclude
Include=
"..\..\include\c11log\details\log_msg.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\null_mutex.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\os.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\pattern_formatter.h"
/>
<ClInclude
Include=
"..\..\include\c11log\details\stack_buf.h"
/>
<ClInclude
Include=
"..\..\include\c11log\factory.h"
/>
<ClInclude
Include=
"..\..\include\c11log\formatter.h"
/>
<ClInclude
Include=
"..\..\include\c11log\logger.h"
/>
<ClInclude
Include=
"..\..\include\c11log\pattern_formatter.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\async_sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\base_sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\ostream_sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\file_sinks.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\isink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\null_sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\sink.h"
/>
<ClInclude
Include=
"..\..\include\c11log\sinks\stdout_sinks.h"
/>
<ClInclude
Include=
"stdafx.h"
/>
<ClInclude
Include=
"targetver.h"
/>
...
...
c11logtest/c11logtest/c11logtest.vcxproj.filters
View file @
ef330729
...
...
@@ -84,17 +84,17 @@
<ClInclude
Include=
"..\..\include\c11log\common.h"
>
<Filter>
Header Files\c11log
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\sinks\isink.h"
>
<Filter>
Header Files\c11log\sinks
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\factory.h"
>
<Filter>
Header Files\c11log
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\fast_istostr.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\pattern_formatter.h"
>
<Filter>
Header Files\c11log
</Filter>
<ClInclude
Include=
"..\..\include\c11log\sinks\sink.h"
>
<Filter>
Header Files\c11log\sinks
</Filter>
</ClInclude>
<ClInclude
Include=
"..\..\include\c11log\details\pattern_formatter.h"
>
<Filter>
Header Files\c11log\details
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
...
...
example/bench.cpp
View file @
ef330729
...
...
@@ -27,11 +27,11 @@ int main(int argc, char* argv[])
cout_logger
.
info
()
<<
"Hello logger"
;
auto
nullsink
=
std
::
make_shared
<
sinks
::
null_sink
<
details
::
null_mutex
>>
();
auto
rotating
=
std
::
make_shared
<
sinks
::
rotating_file_sink_mt
>
(
"myrotating"
,
"txt"
,
1024
*
1024
*
5
,
5
,
100
);
auto
formatter2
=
std
::
unique_ptr
<
formatter
>
(
new
pattern_formatter
(
pattern
));
logger
my_logger
(
"my_logger"
,
nullsink
,
std
::
move
(
formatter2
));
//logger my_logger("my_logger", nullsink);
logger
my_logger
(
"my_logger"
,
rotating
,
std
::
move
(
formatter2
));
auto
start
=
system_clock
::
now
();
for
(
unsigned
int
i
=
1
;
i
<=
howmany
;
++
i
)
...
...
include/c11log/pattern_formatter.h
→
include/c11log/
details/
pattern_formatter.h
View file @
ef330729
...
...
@@ -5,9 +5,9 @@
#include <memory>
#include <vector>
#include "formatter.h"
#include "
details/
log_msg.h"
#include "
details/
fast_oss.h"
#include "
../
formatter.h"
#include "log_msg.h"
#include "fast_oss.h"
namespace
c11log
...
...
@@ -46,7 +46,7 @@ class Y_appender :public pattern_appender
{
void
append
(
const
details
::
log_msg
&
msg
,
details
::
fast_oss
&
oss
)
override
{
oss
.
put_int
(
msg
.
tm_time
.
tm_year
+
1900
,
4
);
oss
.
put_int
(
msg
.
tm_time
.
tm_year
+
1900
,
4
);
}
};
...
...
@@ -140,7 +140,7 @@ public:
{}
void
append
(
const
details
::
log_msg
&
msg
,
details
::
fast_oss
&
oss
)
override
{
oss
.
putc
(
_ch
);
oss
.
putc
(
_ch
);
}
private
:
char
_ch
;
...
...
@@ -163,7 +163,7 @@ public:
private
:
std
::
string
_str
;
};
}
class
pattern_formatter
:
public
formatter
...
...
@@ -180,16 +180,16 @@ private:
void
compile_pattern
(
const
std
::
string
&
pattern
);
};
}
}
inline
c11log
::
pattern_formatter
::
pattern_formatter
(
const
std
::
string
&
pattern
)
inline
c11log
::
details
::
pattern_formatter
::
pattern_formatter
(
const
std
::
string
&
pattern
)
{
compile_pattern
(
pattern
);
}
inline
void
c11log
::
pattern_formatter
::
compile_pattern
(
const
std
::
string
&
pattern
)
inline
void
c11log
::
details
::
pattern_formatter
::
compile_pattern
(
const
std
::
string
&
pattern
)
{
auto
end
=
pattern
.
end
();
for
(
auto
it
=
pattern
.
begin
();
it
!=
end
;
++
it
)
...
...
@@ -209,7 +209,7 @@ inline void c11log::pattern_formatter::compile_pattern(const std::string& patter
}
}
inline
void
c11log
::
pattern_formatter
::
handle_flag
(
char
flag
)
inline
void
c11log
::
details
::
pattern_formatter
::
handle_flag
(
char
flag
)
{
switch
(
flag
)
{
...
...
@@ -271,7 +271,7 @@ inline void c11log::pattern_formatter::handle_flag(char flag)
}
inline
void
c11log
::
pattern_formatter
::
format
(
details
::
log_msg
&
msg
)
inline
void
c11log
::
details
::
pattern_formatter
::
format
(
details
::
log_msg
&
msg
)
{
details
::
fast_oss
oss
;
for
(
auto
&
appender
:
_appenders
)
...
...
include/c11log/logger.h
View file @
ef330729
...
...
@@ -27,7 +27,7 @@ class line_logger;
class
logger
{
public
:
using
sink_ptr
=
std
::
shared_ptr
<
sinks
::
i
sink
>
;
using
sink_ptr
=
std
::
shared_ptr
<
sinks
::
sink
>
;
using
sinks_vector_t
=
std
::
vector
<
sink_ptr
>
;
using
sinks_init_list
=
std
::
initializer_list
<
sink_ptr
>
;
using
formatter_ptr
=
std
::
unique_ptr
<
formatter
>
;
...
...
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