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
974379c9
Commit
974379c9
authored
Apr 10, 2016
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for SPDLOG_NO_ATOMIC_LEVELS in tweakme.h
parent
d0120b48
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
10 deletions
+39
-10
include/spdlog/common.h
include/spdlog/common.h
+9
-3
include/spdlog/details/logger_impl.h
include/spdlog/details/logger_impl.h
+0
-1
include/spdlog/details/null_mutex.h
include/spdlog/details/null_mutex.h
+22
-1
include/spdlog/logger.h
include/spdlog/logger.h
+2
-4
include/spdlog/tweakme.h
include/spdlog/tweakme.h
+6
-0
tests/logs/.gitignore
tests/logs/.gitignore
+0
-1
No files found.
include/spdlog/common.h
View file @
974379c9
...
...
@@ -5,17 +5,20 @@
#pragma once
#include <string>
#include <initializer_list>
#include <chrono>
#include <memory>
#include <atomic>
#include <exception>
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
#include <codecvt>
#include <locale>
#endif
#include <spdlog/details/null_mutex.h>
//visual studio does not support noexcept yet
#ifndef _MSC_VER
#define SPDLOG_NOEXCEPT noexcept
...
...
@@ -23,7 +26,6 @@
#define SPDLOG_NOEXCEPT throw()
#endif
namespace
spdlog
{
...
...
@@ -39,7 +41,11 @@ using log_clock = std::chrono::system_clock;
using
sink_ptr
=
std
::
shared_ptr
<
sinks
::
sink
>
;
using
sinks_init_list
=
std
::
initializer_list
<
sink_ptr
>
;
using
formatter_ptr
=
std
::
shared_ptr
<
spdlog
::
formatter
>
;
#if defined(SPDLOG_NO_ATOMIC_LEVELS)
using
atomic_level
=
details
::
null_atomic_int
;
#else
using
atomic_level
=
std
::
atomic_int
;
#endif
//Log level enum
namespace
level
...
...
include/spdlog/details/logger_impl.h
View file @
974379c9
...
...
@@ -7,7 +7,6 @@
#include <spdlog/logger.h>
#include <atomic>
#include <memory>
#include <string>
...
...
include/spdlog/details/null_mutex.h
View file @
974379c9
...
...
@@ -5,7 +5,8 @@
#pragma once
// null, no cost mutex
#include <atomic>
// null, no cost dummy "mutex" and dummy "atomic" int
namespace
spdlog
{
...
...
@@ -20,5 +21,25 @@ struct null_mutex
return
true
;
}
};
struct
null_atomic_int
{
int
value
;
null_atomic_int
()
=
default
;
null_atomic_int
(
int
val
)
:
value
(
val
)
{}
int
load
(
std
::
memory_order
)
const
{
return
value
;
}
void
store
(
int
val
)
{
value
=
val
;
}
};
}
}
include/spdlog/logger.h
View file @
974379c9
...
...
@@ -18,7 +18,6 @@
#include <vector>
#include <memory>
#include <atomic>
#include <string>
namespace
spdlog
...
...
@@ -104,8 +103,7 @@ protected:
std
::
string
_name
;
std
::
vector
<
sink_ptr
>
_sinks
;
formatter_ptr
_formatter
;
std
::
atomic_int
_level
;
spdlog
::
atomic_level
_level
;
};
}
...
...
include/spdlog/tweakme.h
View file @
974379c9
...
...
@@ -53,6 +53,12 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to avoid spdlog's usage of atomic log levels
// Use only if your code never modifies a logger's log levels concurrently.
// #define SPDLOG_NO_ATOMIC_LEVELS
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Uncomment to enable usage of wchar_t for file names on Windows.
// #define SPDLOG_WCHAR_FILENAMES
...
...
tests/logs/.gitignore
deleted
100644 → 0
View file @
d0120b48
*.txt
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