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
2f6a5eab
Commit
2f6a5eab
authored
Feb 20, 2014
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang
parent
3feba27f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
58 deletions
+21
-58
example.cpp
example/example.cpp
+4
-8
makefile
example/makefile
+6
-6
makefile.clang
example/makefile.clang
+11
-44
No files found.
example/
test
.cpp
→
example/
example
.cpp
View file @
2f6a5eab
...
...
@@ -73,10 +73,7 @@ int main(int argc, char* argv[])
}
int
qsize
=
atoi
(
argv
[
1
]);
int
pushers
=
atoi
(
argv
[
2
]);
//int poppers = atoi(argv[3]);
//testq(qsize, pushers, poppers);
using
namespace
std
::
chrono
;
...
...
@@ -84,14 +81,13 @@ int main(int argc, char* argv[])
auto
null_sink
=
std
::
make_shared
<
c11log
::
sinks
::
null_sink
>
();
auto
stdout_sink
=
std
::
make_shared
<
c11log
::
sinks
::
stdout_sink
>
();
auto
async
=
std
::
make_shared
<
c11log
::
sinks
::
async_sink
>
(
1000
);
auto
fsink
=
std
::
make_shared
<
c11log
::
sinks
::
rotating_file_sink
>
(
"
new
log"
,
"txt"
,
1024
*
1024
*
50
,
5
);
//auto fsink = std::make_shared<c11log::sinks::daily_file_sink>("daily", "txt");
auto
fsink
=
std
::
make_shared
<
c11log
::
sinks
::
rotating_file_sink
>
(
"log"
,
"txt"
,
1024
*
1024
*
50
,
5
);
async
->
add_sink
(
null_
sink
);
async
->
add_sink
(
f
sink
);
auto
&
logger
=
c11log
::
get_logger
(
"async"
);
logger
.
add_sink
(
async
);
testq
(
qsize
,
pushers
);
}
example/makefile
View file @
2f6a5eab
...
...
@@ -3,19 +3,19 @@ CXXFLAGS = -march=native -Wall -Wextra -Wshadow -pedantic -std=c++11 -pthread -I
CXX_RELEASE_FLAGS
=
-O3
-flto
CXX_DEBUG_FLAGS
=
-g
OUTBIN
=
testm
e
OUTBIN
=
exampl
e
all
:
test
.cpp
$(CXX)
test
.cpp
-o
$(OUTBIN)
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
all
:
example
.cpp
$(CXX)
example
.cpp
-o
$(OUTBIN)
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
debug
:
test
.cpp
$(CXX)
test
.cpp
-o
$(OUTBIN)
-debug
$(CXXFLAGS)
$(CXX_DEBUG_FLAFS)
debug
:
example
.cpp
$(CXX)
example
.cpp
-o
$(OUTBIN)
-debug
$(CXXFLAGS)
$(CXX_DEBUG_FLAFS)
clean
:
rm
-f
*
.t
ext
$(OUTBIN)
$(OUTBIN)
-debug
rm
-f
*
.t
xt
$(OUTBIN)
$(OUTBIN)
-debug
rebuild
:
clean all
rebuild-debug
:
clean debug
...
...
example/makefile.clang
View file @
2f6a5eab
SRC_DIR
=
../../src
_SOURCES
=
factory.cpp formatters.cpp os.cpp
SOURCES
=
$
(
patsubst %,
$(SRC_DIR)
/%,
$(_SOURCES)
)
OBJS_RELEASE
=
$
(
patsubst %.cpp,release/%.o,
$(_SOURCES)
)
OBJS_DEBUG
=
$
(
patsubst %.cpp,debug/%.o,
$(_SOURCES)
)
CXX
=
clang++
CXXFLAGS
=
-march
=
native
-Wall
-Wextra
-Wshadow
-pedantic
-std
=
c++11
-pthread
-I
../../include
CXX_RELEASE_FLAGS
=
-O3
-flto
CXX
=
clang++
CXXFLAGS
=
-march
=
native
-Wall
-Wextra
-Wshadow
-pedantic
-std
=
c++11
-pthread
-I
../include
-B
/usr/lib/gold-ld/
CXX_RELEASE_FLAGS
=
-O3
-flto
CXX_DEBUG_FLAGS
=
-g
OUTLIB_RELEASE
=
libc11log.a
OUTLIB_DEBUG
=
libc11log-debug.a
TEST_RELEASE
=
testme-clang
TEST_DEBUG
=
testme-debug-clang
.PHONY
:
all mkdirs release debug build clean rebuild
all
:
release
OUTBIN
=
example-clang
release
:
CXXFLAGS += $(CXX_RELEASE_FLAGS)
release
:
mkdirs build-release
all
:
example.cpp
$(CXX)
example.cpp
-o
$(OUTBIN)
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
debug
:
CXXFLAGS += $(CXX_DEBUG_FLAGS)
debug
:
mkdirs build-debug
debug
:
example.cpp
$(CXX)
example.cpp
-o
$(OUTBIN)
-debug
$(CXXFLAGS)
$(CXX_DEBUG_FLAFS)
mkdirs
:
@
mkdir
-p
release debug
build-release
:
$(OBJS_RELEASE)
ar rs
$(OUTLIB_RELEASE)
$^
$(CXX)
$(SRC_DIR)
/test.cpp
$(OBJS_RELEASE)
-o
$(TEST_RELEASE)
$(CXXFLAGS)
-B
/usr/lib/gold-ld/
build-debug
:
$(OBJS_DEBUG)
ar
--plugin
/usr/local/lib/LLVMgold.so rs
$(OUTLIB_DEBUG)
$^
$(CXX)
$(SRC_DIR)
/test.cpp
$(OBJS_RELEASE)
-o
$(TEST_DEBUG)
$(CXXFLAGS)
-B
/usr/lib/gold-ld/
release/%.o
:
$(SRC_DIR)/%.cpp
$(CXX)
-c
$<
-o
$@
$(CXXFLAGS)
debug/%.o
:
$(SRC_DIR)/%.cpp
$(CXX)
-c
$<
-o
$@
$(CXXFLAGS)
clean
:
rm
-
rf
release debug daily.
*
$(TEST_RELEASE)
$(TEST_DEBUG)
$(OUTLIB_RELEASE)
$(OUTLIB_DEBUG)
rm
-
f
*
.txt
$(OUTBIN)
$(OUTBIN)
-debug
rebuild
:
clean all
rebuild-debug
:
clean debug
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