UMPS
The University of Utah Seismograph Stations Message Passing System.
standardOut.hpp
1 #ifndef UMPS_LOGGING_STANDARD_OUT_HPP
2 #define UMPS_LOGGING_STANDARD_OUT_HPP
3 #include <memory>
4 #include "umps/logging/log.hpp"
5 namespace UMPS::Logging
6 {
13 class StandardOut : public ILog
14 {
15 public:
17  explicit StandardOut(Logging::Level level = Logging::Level::Info);
19  StandardOut(const StandardOut &logger);
21  StandardOut(StandardOut &&logger) noexcept;
22 
26  StandardOut &operator=(const StandardOut &logger);
31  StandardOut &operator=(StandardOut &&logger) noexcept;
32 
34  ~StandardOut() override;
35 
38  void setLevel(Level level) noexcept;
40  [[nodiscard]] Level getLevel() const noexcept override;
41 
44  void error(const std::string &message) override;
47  void warn(const std::string &message) override;
50  void info(const std::string &message) override;
53  void debug(const std::string &message) override;
54 private:
55  class StandardOutImpl;
56  std::unique_ptr<StandardOutImpl> pImpl;
57 };
58 }
59 #endif
Defines the logging level.
This is an abstract base class that allows users to define custom loggers to be used in other applica...
Definition: log.hpp:13
A naive logger that prints all messages to standard out and, in the case of errors,...
Definition: standardOut.hpp:14
void debug(const std::string &message) override
Writes a debug message.
Level getLevel() const noexcept override
StandardOut(const StandardOut &logger)
Copy constructor.
~StandardOut() override
Destructor.
StandardOut & operator=(const StandardOut &logger)
Copy assignment operator.
void info(const std::string &message) override
Writes an info message.
void setLevel(Level level) noexcept
Sets the logging level.
StandardOut(Logging::Level level=Logging::Level::Info)
Constructor.
StandardOut(StandardOut &&logger) noexcept
Move constructor.
void warn(const std::string &message) override
Writes a warning message.
StandardOut & operator=(StandardOut &&logger) noexcept
Move assignment operator.
void error(const std::string &message) override
Writes an error message.