Commit a7b28285 authored by Gabi Melman's avatar Gabi Melman

Added example of user defined class with operator<<

parent 386f7520
...@@ -136,4 +136,17 @@ int main(int, char* []) ...@@ -136,4 +136,17 @@ int main(int, char* [])
std::cout << "Log failed: " << ex.what() << std::endl; std::cout << "Log failed: " << ex.what() << std::endl;
} }
} }
// Example of user defined class with operator<<
class some_class {};
std::ostream& operator<<(std::ostream& os, const some_class& c) { return os << "some_class"; }
void custom_class_example()
{
some_class c;
spdlog::get("console")->info("custom class with operator<<: {}..", c);
spdlog::get("console")->info() << "custom class with operator<<: " << c << "..";
}
``` ```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment