Skip to content

Commit 656e02d

Browse files
committed
Updated to latest oatpp APIs
1 parent 14e37b9 commit 656e02d

File tree

4 files changed

+1
-56
lines changed

4 files changed

+1
-56
lines changed

main/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ set(CMAKE_CXX_STANDARD 11)
55

66
add_library(crud-lib
77
src/AppComponent.hpp
8-
src/Logger.hpp
98
src/SwaggerComponent.hpp
109
src/controller/UserController.hpp
1110
src/db/Database.cpp

main/src/App.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "./controller/UserController.hpp"
1010
#include "./AppComponent.hpp"
11-
#include "./Logger.hpp"
1211

1312
#include "oatpp-swagger/Controller.hpp"
1413
#include "oatpp/network/server/Server.hpp"
@@ -53,14 +52,11 @@ void run() {
5352
* main
5453
*/
5554
int main(int argc, const char * argv[]) {
56-
57-
oatpp::base::Environment::setLogger(new Logger());
55+
5856
oatpp::base::Environment::init();
5957

6058
run();
6159

62-
oatpp::base::Environment::setLogger(nullptr); ///< free Logger
63-
6460
/* Print how much objects were created during app running, and what have left-probably leaked */
6561
/* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */
6662
std::cout << "\nEnvironment:\n";

main/src/Logger.hpp

Lines changed: 0 additions & 34 deletions
This file was deleted.

main/test/tests.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@
1010

1111
namespace {
1212

13-
class Logger : public oatpp::base::Logger {
14-
private:
15-
oatpp::concurrency::SpinLock m_lock;
16-
public:
17-
18-
void log(v_int32 priority, const std::string& tag, const std::string& message) override {
19-
std::lock_guard<oatpp::concurrency::SpinLock> lock(m_lock);
20-
std::cout << tag << ":" << message << "\n";
21-
}
22-
23-
};
24-
2513
class Test : public oatpp::test::UnitTest {
2614
public:
2715
Test() : oatpp::test::UnitTest("MyTag")
@@ -45,13 +33,9 @@ void runTests() {
4533
int main() {
4634

4735
oatpp::base::Environment::init();
48-
oatpp::base::Environment::setLogger(new Logger());
4936

5037
runTests();
5138

52-
oatpp::base::Environment::setLogger(nullptr);
53-
oatpp::base::Environment::destroy();
54-
5539
/* Print how much objects were created during app running, and what have left-probably leaked */
5640
/* Disable object counting for release builds using '-D OATPP_DISABLE_ENV_OBJECT_COUNTERS' flag for better performance */
5741
std::cout << "\nEnvironment:\n";

0 commit comments

Comments
 (0)