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
f4ffddc9
Unverified
Commit
f4ffddc9
authored
Feb 05, 2018
by
Fernando Gomes
Committed by
GitHub
Feb 05, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into to_level
parents
8696ad87
5ab033fb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
20 deletions
+24
-20
example.cpp
example/example.cpp
+2
-2
common.h
include/spdlog/common.h
+1
-1
ansicolor_sink.h
include/spdlog/sinks/ansicolor_sink.h
+2
-2
wincolor_sink.h
include/spdlog/sinks/wincolor_sink.h
+2
-2
CMakeLists.txt
tests/CMakeLists.txt
+17
-13
No files found.
example/example.cpp
View file @
f4ffddc9
...
@@ -64,9 +64,9 @@ int main(int, char*[])
...
@@ -64,9 +64,9 @@ int main(int, char*[])
// Runtime log levels
// Runtime log levels
spd
::
set_level
(
spd
::
level
::
info
);
//Set global log level to info
spd
::
set_level
(
spd
::
level
::
info
);
//Set global log level to info
console
->
debug
(
"This message shold not be displayed!"
);
console
->
debug
(
"This message sho
u
ld not be displayed!"
);
console
->
set_level
(
spd
::
level
::
debug
);
// Set specific logger's log level
console
->
set_level
(
spd
::
level
::
debug
);
// Set specific logger's log level
console
->
debug
(
"This message shold be displayed.."
);
console
->
debug
(
"This message sho
u
ld be displayed.."
);
// Compile time log levels
// Compile time log levels
// define SPDLOG_DEBUG_ON or SPDLOG_TRACE_ON
// define SPDLOG_DEBUG_ON or SPDLOG_TRACE_ON
...
...
include/spdlog/common.h
View file @
f4ffddc9
...
@@ -112,7 +112,7 @@ inline spdlog::level::level_enum to_level_enum(const char* name)
...
@@ -112,7 +112,7 @@ inline spdlog::level::level_enum to_level_enum(const char* name)
}
}
return
(
spdlog
::
level
::
level_enum
)
0
;
return
(
spdlog
::
level
::
level_enum
)
0
;
}
}
using
level_hasher
=
std
::
hash
<
int
>
;
}
//level
}
//level
...
...
include/spdlog/sinks/ansicolor_sink.h
View file @
f4ffddc9
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
#include "../details/os.h"
#include "../details/os.h"
#include <string>
#include <string>
#include <map>
#include <
unordered_
map>
namespace
spdlog
namespace
spdlog
{
{
...
@@ -104,7 +104,7 @@ protected:
...
@@ -104,7 +104,7 @@ protected:
}
}
FILE
*
target_file_
;
FILE
*
target_file_
;
bool
should_do_colors_
;
bool
should_do_colors_
;
std
::
map
<
level
::
level_enum
,
std
::
string
>
colors_
;
std
::
unordered_map
<
level
::
level_enum
,
std
::
string
,
level
::
level_hasher
>
colors_
;
};
};
...
...
include/spdlog/sinks/wincolor_sink.h
View file @
f4ffddc9
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#include <mutex>
#include <mutex>
#include <string>
#include <string>
#include <map>
#include <
unordered_
map>
#include <wincon.h>
#include <wincon.h>
namespace
spdlog
namespace
spdlog
...
@@ -73,7 +73,7 @@ protected:
...
@@ -73,7 +73,7 @@ protected:
private
:
private
:
HANDLE
out_handle_
;
HANDLE
out_handle_
;
std
::
map
<
level
::
level_enum
,
WORD
>
colors_
;
std
::
unordered_map
<
level
::
level_enum
,
WORD
,
level
::
level_hasher
>
colors_
;
// set color and return the orig console attributes (for resetting later)
// set color and return the orig console attributes (for resetting later)
WORD
set_console_attribs
(
WORD
attribs
)
WORD
set_console_attribs
(
WORD
attribs
)
...
...
tests/CMakeLists.txt
View file @
f4ffddc9
#
project
(
spdlog-utests
)
# Tests
#
enable_testing
()
enable_testing
()
find_package
(
Threads REQUIRED
)
find_package
(
Threads
)
set
(
SPDLOG_UTESTS_SOURCES
errors.cpp
file_helper.cpp
file_log.cpp
format.cpp
includes.h
registry.cpp
test_macros.cpp
utils.cpp
utils.h
main.cpp
)
# Build Catch unit tests
add_executable
(
${
PROJECT_NAME
}
${
SPDLOG_UTESTS_SOURCES
}
)
add_library
(
catch INTERFACE
)
target_link_libraries
(
${
PROJECT_NAME
}
PRIVATE Threads::Threads
)
target_
include_directories
(
catch INTERFACE
${
CMAKE_CURRENT_SOURCE_DIR
}
)
target_
link_libraries
(
${
PROJECT_NAME
}
PRIVATE spdlog
)
file
(
GLOB catch_tests LIST_DIRECTORIES false RELATIVE
${
CMAKE_CURRENT_SOURCE_DIR
}
*.cpp *.h *.hpp
)
add_test
(
NAME
${
PROJECT_NAME
}
COMMAND
${
PROJECT_NAME
}
)
add_executable
(
catch_tests
${
catch_tests
}
)
target_link_libraries
(
catch_tests spdlog
${
CMAKE_THREAD_LIBS_INIT
}
)
add_test
(
NAME catch_tests COMMAND catch_tests
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
file
(
MAKE_DIRECTORY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/logs"
)
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