Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThePhD <phdofthehouse@gmail.com>2017-05-31 19:52:12 +0300
committerThePhD <phdofthehouse@gmail.com>2017-05-31 19:52:12 +0300
commitd98d54896b1be50cbbf58e2310df65d96f65c970 (patch)
tree690a1cff8580f8d0b25b1f7019fefbf42543cf00 /include/spdlog/formatter.h
parent18a0455b9184187bdb4ed60092a1872b778ded9b (diff)
use if statement instead of switch (changes of adding new time specifications outside of standard are probably unlikely anyhow)
pattern_time -> pattern_time_type ptime variable name -> pattern_time variable name make sure four spaces used, not tabs
Diffstat (limited to 'include/spdlog/formatter.h')
-rw-r--r--include/spdlog/formatter.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/spdlog/formatter.h b/include/spdlog/formatter.h
index b2b5a5ca..6bba9025 100644
--- a/include/spdlog/formatter.h
+++ b/include/spdlog/formatter.h
@@ -29,16 +29,17 @@ class pattern_formatter SPDLOG_FINAL : public formatter
{
public:
- explicit pattern_formatter(const std::string& pattern, pattern_time ptime = pattern_time::local);
+ explicit pattern_formatter(const std::string& pattern, pattern_time_type pattern_time = pattern_time_type::local);
pattern_formatter(const pattern_formatter&) = delete;
pattern_formatter& operator=(const pattern_formatter&) = delete;
void format(details::log_msg& msg) override;
private:
const std::string _pattern;
- const pattern_time _time;
+ const pattern_time_type _pattern_time;
std::vector<std::unique_ptr<details::flag_formatter>> _formatters;
+ std::tm get_time(details::log_msg& msg);
void handle_flag(char flag);
- void compile_pattern(const std::string& pattern, pattern_time ptime);
+ void compile_pattern(const std::string& pattern);
};
}