Skip to content

Commit 6772205

Browse files
authored
Merge pull request #1358 from joto/color-output
Decouple color output from log settings
2 parents 52a217f + 1e80ec7 commit 6772205

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/logging.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class logger
3535
return;
3636
}
3737

38-
auto const &ts = m_show_progress ? style : fmt::text_style{};
38+
auto const &ts = m_use_color ? style : fmt::text_style{};
3939

4040
std::string str =
4141
"{:%Y-%m-%d %H:%M:%S} "_format(fmt::localtime(std::time(nullptr)));
@@ -71,6 +71,7 @@ class logger
7171
bool m_log_sql = false;
7272
bool m_log_sql_data = false;
7373
bool m_show_progress = true;
74+
bool m_use_color = osmium::util::isatty(2);
7475

7576
}; // class logger
7677

0 commit comments

Comments
 (0)