File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ # VS Code
2+ .vscode /
3+
14# Generated config files for editors
25/.clang_complete
36/.linter-clang-flags
Original file line number Diff line number Diff line change 2525
2626// Internal Includes
2727#include < osvr/Util/LogRegistry.h>
28+ #include < osvr/Util/GetEnvironmentVariable.h>
2829
2930#include " LogDefaults.h"
3031#include " LogLevelTranslate.h"
@@ -197,11 +198,24 @@ namespace util {
197198 }
198199 }
199200
201+ static inline bool shouldLogToFile () {
202+ using osvr::util::getEnvironmentVariable;
203+ auto fileLoggingEnabled = getEnvironmentVariable (" OSVR_FILE_LOGGING_ENABLED" );
204+ if (!fileLoggingEnabled || *fileLoggingEnabled == " 0" ) {
205+ return false ;
206+ }
207+ return true ;
208+ }
209+
200210 void LogRegistry::createFileSink () {
201211#if defined(OSVR_ANDROID)
202212 // Not logging to file on Android.
203213 return ;
204214#else
215+ if (!shouldLogToFile ()) {
216+ return ;
217+ }
218+
205219 // File sink - rotates daily
206220 std::string logDir;
207221 try {
You can’t perform that action at this time.
0 commit comments