Category : logging

Consider a class foo which has one or more functions which can report failure either through a logger or by throwing an exception if no logger was provided: struct logger { // … }; struct foo { void set_logger(std::shared_ptr<logger> logger) { m_logger = std::move(logger); } bool bar(const std::filesystem::path& path) { // Check path validity if ..

Read more