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
e1c79869
Commit
e1c79869
authored
Mar 22, 2020
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced more SPDLOG_THROW with throw_spdlog_ex
parent
d3997cc4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
9 deletions
+8
-9
include/spdlog/details/os-inl.h
include/spdlog/details/os-inl.h
+3
-3
include/spdlog/details/tcp_client.h
include/spdlog/details/tcp_client.h
+3
-3
include/spdlog/sinks/rotating_file_sink-inl.h
include/spdlog/sinks/rotating_file_sink-inl.h
+1
-2
include/spdlog/sinks/win_eventlog_sink.h
include/spdlog/sinks/win_eventlog_sink.h
+1
-1
No files found.
include/spdlog/details/os-inl.h
View file @
e1c79869
...
...
@@ -262,7 +262,7 @@ SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm)
auto
rv
=
::
GetDynamicTimeZoneInformation
(
&
tzinfo
);
#endif
if
(
rv
==
TIME_ZONE_ID_INVALID
)
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
"Failed getting timezone info. "
,
errno
)
);
throw_spdlog_ex
(
"Failed getting timezone info. "
,
errno
);
int
offset
=
-
tzinfo
.
Bias
;
if
(
tm
.
tm_isdst
)
...
...
@@ -429,7 +429,7 @@ SPDLOG_INLINE void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target)
{
if
(
wstr
.
size
()
>
static_cast
<
size_t
>
((
std
::
numeric_limits
<
int
>::
max
)()))
{
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
"UTF-16 string is too big to be converted to UTF-8"
)
);
throw_spdlog_ex
(
"UTF-16 string is too big to be converted to UTF-8"
);
}
int
wstr_size
=
static_cast
<
int
>
(
wstr
.
size
());
...
...
@@ -457,7 +457,7 @@ SPDLOG_INLINE void wstr_to_utf8buf(wstring_view_t wstr, memory_buf_t &target)
}
}
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
fmt
::
format
(
"WideCharToMultiByte failed. Last error: {}"
,
::
GetLastError
()
)));
throw_spdlog_ex
(
fmt
::
format
(
"WideCharToMultiByte failed. Last error: {}"
,
::
GetLastError
(
)));
}
#endif // (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32)
...
...
include/spdlog/details/tcp_client.h
View file @
e1c79869
...
...
@@ -68,7 +68,7 @@ public:
if
(
rv
!=
0
)
{
auto
msg
=
fmt
::
format
(
"::getaddrinfo failed: {}"
,
gai_strerror
(
rv
));
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
msg
)
);
throw_spdlog_ex
(
msg
);
}
// Try each address until we successfully connect(2).
...
...
@@ -97,7 +97,7 @@ public:
::
freeaddrinfo
(
addrinfo_result
);
if
(
socket_
==
-
1
)
{
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
"::connect failed"
,
last_errno
)
);
throw_spdlog_ex
(
"::connect failed"
,
last_errno
);
}
// set TCP_NODELAY
...
...
@@ -130,7 +130,7 @@ public:
if
(
write_result
<
0
)
{
close
();
SPDLOG_THROW
(
spdlog
::
spdlog_ex
(
"write(2) failed"
,
errno
)
);
throw_spdlog_ex
(
"write(2) failed"
,
errno
);
}
if
(
write_result
==
0
)
// (probably should not happen but in any case..)
...
...
include/spdlog/sinks/rotating_file_sink-inl.h
View file @
e1c79869
...
...
@@ -110,8 +110,7 @@ SPDLOG_INLINE void rotating_file_sink<Mutex>::rotate_()
{
file_helper_
.
reopen
(
true
);
// truncate the log file anyway to prevent it to grow beyond its limit!
current_size_
=
0
;
SPDLOG_THROW
(
spdlog_ex
(
"rotating_file_sink: failed renaming "
+
filename_to_str
(
src
)
+
" to "
+
filename_to_str
(
target
),
errno
));
throw_spdlog_ex
(
"rotating_file_sink: failed renaming "
+
filename_to_str
(
src
)
+
" to "
+
filename_to_str
(
target
),
errno
);
}
}
}
...
...
include/spdlog/sinks/win_eventlog_sink.h
View file @
e1c79869
...
...
@@ -176,7 +176,7 @@ struct eventlog
default:
// should be unreachable
SPDLOG_THROW
(
std
::
logic_error
(
fmt
::
format
(
"Unsupported log level {}"
,
msg
.
level
)
));
throw_spdlog_ex
(
fmt
::
format
(
"Unsupported log level {}"
,
msg
.
level
));
}
}
...
...
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