Skip to content

Commit

Permalink
remove alternative logging interface
Browse files Browse the repository at this point in the history
  • Loading branch information
samcmill committed Mar 23, 2020
1 parent 47c5ad6 commit 08bd225
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 39 deletions.
12 changes: 0 additions & 12 deletions include/wassail/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,6 @@ namespace wassail {
return fmt::vformat(fmt, {fmt::make_format_args(args...)});
}

/*! \brief Basic interface to the internal logger
*
* This function is provided so that templated code and other
* public interfaces can use the internal logger without exposing
* the details of the internal logger interface. This should not
* be used by user code.
*
* \param[in] log_level Log level
* \param[in] msg Log message
*/
void logger(const log_level log_level, const std::string msg);

/*! \brief Return the wassail library version */
std::string version();

Expand Down
5 changes: 4 additions & 1 deletion src/checks/rules_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "internal.hpp"

#include <functional>
#include <vector>
#include <wassail/checks/rules_engine.hpp>
Expand Down Expand Up @@ -37,7 +39,8 @@ namespace wassail {
}
}
catch (std::exception &e) {
logger(log_level::warn, e.what() + std::string(": ") + j.dump());
wassail::internal::logger()->warn(e.what() + std::string(": ") +
j.dump());
r->issue = result::issue_t::MAYBE;
r->detail = wassail::format(fmt_str.detail_maybe, e.what());
}
Expand Down
26 changes: 0 additions & 26 deletions src/common/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,4 @@ namespace wassail {
return (logger);
}
} // namespace internal

void logger(const log_level log_level, const std::string msg) {
switch (log_level) {
case wassail::log_level::trace:
wassail::internal::logger()->trace(msg);
break;
case wassail::log_level::debug:
wassail::internal::logger()->debug(msg);
break;
case wassail::log_level::info:
wassail::internal::logger()->info(msg);
break;
case wassail::log_level::warn:
wassail::internal::logger()->warn(msg);
break;
case wassail::log_level::err:
wassail::internal::logger()->error(msg);
break;
case wassail::log_level::critical:
wassail::internal::logger()->critical(msg);
break;
default:
/* do nothing */
break;
}
}
} // namespace wassail

0 comments on commit 08bd225

Please sign in to comment.