]> git.lizzy.rs Git - minetest.git/blobdiff - src/log.h
Fix core.get_player_by_name() returning unusable ObjectRef
[minetest.git] / src / log.h
index 952ebadb1959a8544ea2b1f1a139e33007136c9f..6350d8a8659b0ff0d555326d525b513e406c1105 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -118,16 +118,16 @@ class StreamLogOutput : public ICombinedLogOutput {
                m_stream(stream)
        {
 #if !defined(_WIN32)
-               colored = (Logger::color_mode == LOG_COLOR_ALWAYS) ||
-                       (Logger::color_mode == LOG_COLOR_AUTO && isatty(fileno(stdout)));
+               is_tty = isatty(fileno(stdout));
 #else
-               colored = Logger::color_mode == LOG_COLOR_ALWAYS;
+               is_tty = false;
 #endif
        }
 
        void logRaw(LogLevel lev, const std::string &line)
        {
-               bool colored_message = colored;
+               bool colored_message = (Logger::color_mode == LOG_COLOR_ALWAYS) ||
+                       (Logger::color_mode == LOG_COLOR_AUTO && is_tty);
                if (colored_message)
                        switch (lev) {
                        case LL_ERROR:
@@ -160,12 +160,12 @@ class StreamLogOutput : public ICombinedLogOutput {
 
 private:
        std::ostream &m_stream;
-       bool colored;
+       bool is_tty;
 };
 
 class FileLogOutput : public ICombinedLogOutput {
 public:
-       void open(const std::string &filename);
+       void setFile(const std::string &filename, s64 file_size_max);
 
        void logRaw(LogLevel lev, const std::string &line)
        {