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
b13735dc
Commit
b13735dc
authored
Aug 22, 2016
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle
parent
20cb73e9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
55 deletions
+57
-55
common.h
include/spdlog/common.h
+53
-53
mpmc_bounded_q.h
include/spdlog/details/mpmc_bounded_q.h
+0
-0
os.h
include/spdlog/details/os.h
+4
-2
No files found.
include/spdlog/common.h
View file @
b13735dc
...
...
@@ -43,30 +43,30 @@
namespace
spdlog
{
class
formatter
;
class
formatter
;
namespace
sinks
{
class
sink
;
}
namespace
sinks
{
class
sink
;
}
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
>
;
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
level_t
=
details
::
null_atomic_int
;
using
level_t
=
details
::
null_atomic_int
;
#else
using
level_t
=
std
::
atomic_int
;
using
level_t
=
std
::
atomic_int
;
#endif
using
log_err_handler
=
std
::
function
<
void
(
const
std
::
string
&
err_msg
)
>
;
using
log_err_handler
=
std
::
function
<
void
(
const
std
::
string
&
err_msg
)
>
;
//Log level enum
namespace
level
{
typedef
enum
{
//Log level enum
namespace
level
{
typedef
enum
{
trace
=
0
,
debug
=
1
,
info
=
2
,
...
...
@@ -74,47 +74,47 @@ namespace spdlog
err
=
4
,
critical
=
5
,
off
=
6
}
level_enum
;
}
level_enum
;
static
const
char
*
level_names
[]{
"trace"
,
"debug"
,
"info"
,
"warning"
,
"error"
,
"critical"
,
"off"
};
static
const
char
*
level_names
[]
{
"trace"
,
"debug"
,
"info"
,
"warning"
,
"error"
,
"critical"
,
"off"
};
static
const
char
*
short_level_names
[]{
"T"
,
"D"
,
"I"
,
"W"
,
"E"
,
"C"
,
"O"
};
static
const
char
*
short_level_names
[]
{
"T"
,
"D"
,
"I"
,
"W"
,
"E"
,
"C"
,
"O"
};
inline
const
char
*
to_str
(
spdlog
::
level
::
level_enum
l
)
{
inline
const
char
*
to_str
(
spdlog
::
level
::
level_enum
l
)
{
return
level_names
[
l
];
}
}
inline
const
char
*
to_short_str
(
spdlog
::
level
::
level_enum
l
)
{
inline
const
char
*
to_short_str
(
spdlog
::
level
::
level_enum
l
)
{
return
short_level_names
[
l
];
}
}
//level
}
}
//level
//
// Async overflow policy - block by default.
//
enum
class
async_overflow_policy
{
//
// Async overflow policy - block by default.
//
enum
class
async_overflow_policy
{
block_retry
,
// Block / yield / sleep until message can be enqueued
discard_log_msg
// Discard the message it enqueue fails
};
};
//
// Log exception
//
namespace
details
{
namespace
os
{
std
::
string
errno_str
(
int
err_num
);
}
}
class
spdlog_ex
:
public
std
::
exception
{
public
:
//
// Log exception
//
namespace
details
{
namespace
os
{
std
::
string
errno_str
(
int
err_num
);
}
}
class
spdlog_ex
:
public
std
::
exception
{
public
:
spdlog_ex
(
const
std
::
string
&
msg
)
:
_msg
(
msg
)
{}
spdlog_ex
(
const
std
::
string
&
msg
,
int
last_errno
)
...
...
@@ -125,18 +125,18 @@ namespace spdlog
{
return
_msg
.
c_str
();
}
private
:
private
:
std
::
string
_msg
;
};
};
//
// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined)
//
//
// wchar support for windows file names (SPDLOG_WCHAR_FILENAMES must be defined)
//
#if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES)
using
filename_t
=
std
::
wstring
;
using
filename_t
=
std
::
wstring
;
#else
using
filename_t
=
std
::
string
;
using
filename_t
=
std
::
string
;
#endif
...
...
include/spdlog/details/mpmc_bounded_q.h
View file @
b13735dc
include/spdlog/details/os.h
View file @
b13735dc
...
...
@@ -253,8 +253,10 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime())
#if defined(sun) || defined(__sun)
// 'tm_gmtoff' field is BSD extension and it's missing on SunOS/Solaris
struct
helper
{
static
long
int
calculate_gmt_offset
(
const
std
::
tm
&
localtm
=
details
::
os
::
localtime
(),
const
std
::
tm
&
gmtm
=
details
::
os
::
gmtime
())
{
struct
helper
{
static
long
int
calculate_gmt_offset
(
const
std
::
tm
&
localtm
=
details
::
os
::
localtime
(),
const
std
::
tm
&
gmtm
=
details
::
os
::
gmtime
())
{
int
local_year
=
localtm
.
tm_year
+
(
1900
-
1
);
int
gmt_year
=
gmtm
.
tm_year
+
(
1900
-
1
);
...
...
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