Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
ec3f2b76
Commit
ec3f2b76
authored
Dec 04, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip path from __FILE__ in SPDLOG_TRACE macros
parent
f0c962d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
include/spdlog/common.h
include/spdlog/common.h
+16
-1
include/spdlog/spdlog.h
include/spdlog/spdlog.h
+1
-1
No files found.
include/spdlog/common.h
View file @
ec3f2b76
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <memory>
#include <memory>
#include <stdexcept>
#include <stdexcept>
#include <string>
#include <string>
#include <cstring>
#include <type_traits>
#include <type_traits>
#include <unordered_map>
#include <unordered_map>
...
@@ -24,6 +25,8 @@
...
@@ -24,6 +25,8 @@
#include "spdlog/details/null_mutex.h"
#include "spdlog/details/null_mutex.h"
#include "spdlog/fmt/fmt.h"
// visual studio upto 2013 does not support noexcept nor constexpr
// visual studio upto 2013 does not support noexcept nor constexpr
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define SPDLOG_NOEXCEPT throw()
#define SPDLOG_NOEXCEPT throw()
...
@@ -48,7 +51,19 @@
...
@@ -48,7 +51,19 @@
#endif
#endif
#endif
#endif
#include "spdlog/fmt/fmt.h"
// Get the basename of __FILE__ (at compile time if possible)
#if FMT_HAS_FEATURE(__builtin_strrchr)
#define SPDLOG_STRRCHR(str, sep) __builtin_strrchr(str, sep)
#else
#define SPDLOG_STRRCHR(str, sep) strrchr(str, sep)
#endif //__builtin_strrchr not defined
#ifdef _WIN32
#define SPDLOG_FILE_BASENAME SPDLOG_STRRCHR("\\" __FILE__, '\\') + 1
#else
#define SPDLOG_FILE_BASENAME SPDLOG_STRRCHR("/" __FILE__, '/') + 1
#endif
namespace
spdlog
{
namespace
spdlog
{
...
...
include/spdlog/spdlog.h
View file @
ec3f2b76
...
@@ -314,7 +314,7 @@ inline void critical(const wchar_t *fmt, const Args &... args)
...
@@ -314,7 +314,7 @@ inline void critical(const wchar_t *fmt, const Args &... args)
//
//
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->log(spdlog::source_loc{
__FILE__
, __LINE__}, spdlog::level::trace, __VA_ARGS__)
#define SPDLOG_LOGGER_TRACE(logger, ...) logger->log(spdlog::source_loc{
SPDLOG_FILE_BASENAME
, __LINE__}, spdlog::level::trace, __VA_ARGS__)
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
#define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
#else
#else
#define SPDLOG_LOGGER_TRACE(logger, ...) (void)0
#define SPDLOG_LOGGER_TRACE(logger, ...) (void)0
...
...
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