~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/render/rConsole.cpp

  • Committer: SwagTron
  • Date: 2019-07-20 04:02:42 UTC
  • Revision ID: swagtron-20190720040242-lplv5930uwr5mwja
Added missing SET_DEFAULT_HELP and SET_DEFAULT_CONFIG_FILE_HELP in english_base.txt
Added CONSOLE_LOG_TIMESTAMP. This determines if the timestamp will be added to each line in consolelog.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
static bool sr_consoleLog = false;
98
98
static tConfItem<bool> sr_consoleLogConf("CONSOLE_LOG", sr_consoleLog);
99
99
 
 
100
static bool sr_consoleLogTimestamp = true;
 
101
static tConfItem<bool> sr_consoleLogTimestampConf("CONSOLE_LOG_TIMESTAMP", sr_consoleLogTimestamp);
 
102
 
100
103
static bool sr_consoleLogColor = false;
101
104
static tConfItem<bool> sr_consoleLogColorConf("CONSOLE_LOG_COLOR", sr_consoleLogColor);
102
105
 
119
122
        std::cout.flush();
120
123
    }
121
124
 
122
 
    if(!tRecorder::IsPlayingBack() && sr_consoleLog) {
 
125
    if(!tRecorder::IsPlayingBack() && sr_consoleLog) 
 
126
    {
123
127
            std::ofstream o;
124
128
            if ( tDirectories::Var().Open(o, "consolelog.txt", std::ios::app) ) {
125
 
                o << st_GetCurrentTime("[%Y/%m/%d-%H:%M:%S] ") << tColoredString::RemoveColors(s);
 
129
                if (sr_consoleLogTimestamp)
 
130
                {
 
131
                    o << st_GetCurrentTime("[%Y/%m/%d-%H:%M:%S] ") << tColoredString::RemoveColors(s);
 
132
                }
 
133
                else
 
134
                {
 
135
                    o << tColoredString::RemoveColors(s);
 
136
                }
126
137
            }
127
138
    }
128
139