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
56795442
Commit
56795442
authored
Sep 10, 2015
by
Ruslan Baratov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return unsuccessful exit code if error occurs
parent
88cfb193
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
example/bench.cpp
example/bench.cpp
+4
-2
example/example.cpp
example/example.cpp
+3
-0
No files found.
example/bench.cpp
View file @
56795442
...
@@ -25,11 +25,12 @@
...
@@ -25,11 +25,12 @@
//
//
// bench.cpp : spdlog benchmarks
// bench.cpp : spdlog benchmarks
//
//
#include <atomic>
#include <cstdlib> // EXIT_FAILURE
#include <iostream>
#include <iostream>
#include <memory>
#include <memory>
#include <string>
#include <string>
#include <thread>
#include <thread>
#include <atomic>
#include "spdlog/spdlog.h"
#include "spdlog/spdlog.h"
#include "spdlog/async_logger.h"
#include "spdlog/async_logger.h"
#include "spdlog/sinks/file_sinks.h"
#include "spdlog/sinks/file_sinks.h"
...
@@ -108,8 +109,9 @@ int main(int argc, char* argv[])
...
@@ -108,8 +109,9 @@ int main(int argc, char* argv[])
{
{
std
::
cerr
<<
"Error: "
<<
ex
.
what
()
<<
std
::
endl
;
std
::
cerr
<<
"Error: "
<<
ex
.
what
()
<<
std
::
endl
;
perror
(
"Last error"
);
perror
(
"Last error"
);
return
EXIT_FAILURE
;
}
}
return
0
;
return
EXIT_SUCCESS
;
}
}
...
...
example/example.cpp
View file @
56795442
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
//
//
// spdlog usage example
// spdlog usage example
//
//
#include <cstdlib> // EXIT_FAILURE
#include <iostream>
#include <iostream>
#include "spdlog/spdlog.h"
#include "spdlog/spdlog.h"
...
@@ -106,7 +107,9 @@ int main(int, char*[])
...
@@ -106,7 +107,9 @@ int main(int, char*[])
catch
(
const
spd
::
spdlog_ex
&
ex
)
catch
(
const
spd
::
spdlog_ex
&
ex
)
{
{
std
::
cout
<<
"Log failed: "
<<
ex
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"Log failed: "
<<
ex
.
what
()
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
}
return
EXIT_SUCCESS
;
}
}
...
...
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