diff options
author | Antony Woods <acron1@gmail.com> | 2014-05-23 08:22:12 +0100 |
---|---|---|
committer | Antony Woods <acron1@gmail.com> | 2014-05-23 08:22:12 +0100 |
commit | 639bacf0241346d8fa81ab2d256f90651c9b3ba7 (patch) | |
tree | 4c2d1eee324d9a2992bf1bbaf2c93fa8441e93f0 /example.cpp | |
parent | 1ae0387a255c7ec891179e3880579368b6cc588d (diff) | |
download | crow-639bacf0241346d8fa81ab2d256f90651c9b3ba7.tar.gz crow-639bacf0241346d8fa81ab2d256f90651c9b3ba7.zip |
Added log handlers via the ILogHandler interface. At the moment these are sti pretty trivial but should still allow you to add handlers for network, file etc.
Diffstat (limited to 'example.cpp')
-rw-r--r-- | example.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/example.cpp b/example.cpp index 4af7c75..5491ba2 100644 --- a/example.cpp +++ b/example.cpp @@ -3,6 +3,13 @@ #include <sstream> +class ExampleLogHandler : public crow::ILogHandler { + public: + void log(string message, crow::LogLevel level) override { + cerr << "ExampleLogHandler -> " << message; + } +}; + int main() { crow::Crow app; @@ -53,6 +60,9 @@ int main() return crow::response{os.str()}; }); + //crow::logger::setLogLevel(LogLevel::INFO); + //crow::logger::setHandler(std::make_shared<ExampleLogHandler>()); + app.port(18080) .multithreaded() .run(); |