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
de642b62
Commit
de642b62
authored
Feb 25, 2018
by
Daniel Chabrowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astyle applied
parent
5355bd3a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
18 deletions
+21
-18
include/spdlog/details/async_log_helper.h
include/spdlog/details/async_log_helper.h
+8
-8
include/spdlog/details/file_helper.h
include/spdlog/details/file_helper.h
+2
-1
include/spdlog/details/os.h
include/spdlog/details/os.h
+7
-7
include/spdlog/details/pattern_formatter_impl.h
include/spdlog/details/pattern_formatter_impl.h
+2
-1
include/spdlog/sinks/file_sinks.h
include/spdlog/sinks/file_sinks.h
+2
-1
No files found.
include/spdlog/details/async_log_helper.h
View file @
de642b62
...
...
@@ -64,14 +64,14 @@ class async_log_helper
msg_id
(
0
)
{}
async_msg
(
async_msg
&&
other
)
SPDLOG_NOEXCEPT
:
logger_name
(
std
::
move
(
other
.
logger_name
)),
level
(
std
::
move
(
other
.
level
)),
time
(
std
::
move
(
other
.
time
)),
thread_id
(
other
.
thread_id
),
txt
(
std
::
move
(
other
.
txt
)),
msg_type
(
std
::
move
(
other
.
msg_type
)),
msg_id
(
other
.
msg_id
)
async_msg
(
async_msg
&&
other
)
SPDLOG_NOEXCEPT
:
logger_name
(
std
::
move
(
other
.
logger_name
)),
level
(
std
::
move
(
other
.
level
)),
time
(
std
::
move
(
other
.
time
)),
thread_id
(
other
.
thread_id
),
txt
(
std
::
move
(
other
.
txt
)),
msg_type
(
std
::
move
(
other
.
msg_type
)),
msg_id
(
other
.
msg_id
)
{}
async_msg
&
operator
=
(
async_msg
&&
other
)
SPDLOG_NOEXCEPT
...
...
include/spdlog/details/file_helper.h
View file @
de642b62
...
...
@@ -90,7 +90,8 @@ public:
size_t
size
()
const
{
if
(
_fd
==
nullptr
)
{
if
(
_fd
==
nullptr
)
{
throw
spdlog_ex
(
"Cannot use size() on closed file "
+
os
::
filename_to_str
(
_filename
));
}
return
os
::
filesize
(
_fd
);
...
...
include/spdlog/details/os.h
View file @
de642b62
...
...
@@ -81,10 +81,10 @@ inline std::tm localtime(const std::time_t &time_tt)
{
#ifdef _WIN32
std
::
tm
tm
{};
std
::
tm
tm
{};
localtime_s
(
&
tm
,
&
time_tt
);
#else
std
::
tm
tm
{};
std
::
tm
tm
{};
localtime_r
(
&
time_tt
,
&
tm
);
#endif
return
tm
;
...
...
@@ -100,10 +100,10 @@ inline std::tm gmtime(const std::time_t &time_tt)
{
#ifdef _WIN32
std
::
tm
tm
{};
std
::
tm
tm
{};
gmtime_s
(
&
tm
,
&
time_tt
);
#else
std
::
tm
tm
{};
std
::
tm
tm
{};
gmtime_r
(
&
time_tt
,
&
tm
);
#endif
return
tm
;
...
...
@@ -219,7 +219,7 @@ inline bool file_exists(const filename_t& filename)
#endif
return
(
attribs
!=
INVALID_FILE_ATTRIBUTES
&&
!
(
attribs
&
FILE_ATTRIBUTE_DIRECTORY
));
#else //common linux/unix all have the stat system call
struct
stat
buffer
{};
struct
stat
buffer
{};
return
(
stat
(
filename
.
c_str
(),
&
buffer
)
==
0
);
#endif
}
...
...
@@ -249,11 +249,11 @@ inline size_t filesize(FILE *f)
int
fd
=
fileno
(
f
);
//64 bits(but not in osx or cygwin, where fstat64 is deprecated)
#if !defined(__FreeBSD__) && !defined(__APPLE__) && (defined(__x86_64__) || defined(__ppc64__)) && !defined(__CYGWIN__)
struct
stat64
st
{};
struct
stat64
st
{};
if
(
fstat64
(
fd
,
&
st
)
==
0
)
return
static_cast
<
size_t
>
(
st
.
st_size
);
#else // unix 32 bits or cygwin
struct
stat
st
{};
struct
stat
st
{};
if
(
fstat
(
fd
,
&
st
)
==
0
)
return
static_cast
<
size_t
>
(
st
.
st_size
);
#endif
...
...
include/spdlog/details/pattern_formatter_impl.h
View file @
de642b62
...
...
@@ -648,7 +648,8 @@ inline void spdlog::pattern_formatter::handle_flag(char flag)
inline
std
::
tm
spdlog
::
pattern_formatter
::
get_time
(
details
::
log_msg
&
msg
)
{
if
(
_pattern_time
==
pattern_time_type
::
local
)
{
if
(
_pattern_time
==
pattern_time_type
::
local
)
{
return
details
::
os
::
localtime
(
log_clock
::
to_time_t
(
msg
.
time
));
}
return
details
::
os
::
gmtime
(
log_clock
::
to_time_t
(
msg
.
time
));
...
...
include/spdlog/sinks/file_sinks.h
View file @
de642b62
...
...
@@ -235,7 +235,8 @@ private:
date
.
tm_min
=
_rotation_m
;
date
.
tm_sec
=
0
;
auto
rotation_time
=
std
::
chrono
::
system_clock
::
from_time_t
(
std
::
mktime
(
&
date
));
if
(
rotation_time
>
now
)
{
if
(
rotation_time
>
now
)
{
return
rotation_time
;
}
return
{
rotation_time
+
std
::
chrono
::
hours
(
24
)
};
...
...
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