| 12345678910111213141516171819202122232425262728293031323334 |
- //
- // format.hpp
- // logger
- //
- // Created by Sam Jaffe on 8/21/16.
- //
- #pragma once
- #include <string>
- #include <vector>
- #include "wrapper_object.h"
- namespace logging {
- class message {
- private:
- std::string format_code;
- std::vector<detail::object> objects;
- public:
- message() = default;
- message(char const * fmt) : format_code(fmt) {}
- template <typename... Args>
- message(std::string const & fmt, Args &&... args);
- std::string str() const;
- Json::Value json() const;
- };
- template <typename... Args>
- message::message(std::string const & fmt, Args &&... args)
- : format_code(fmt), objects({detail::object(args)...}) {}
- }
|