From 4f64c12ca9b108fd779087305512b06302212bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 31 Mar 2023 02:10:15 -0300 Subject: [PATCH] ecode: Minor fix with the logs. --- src/tools/ecode/ecode.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index c1c1ed996..c5e48214f 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -472,13 +472,12 @@ void App::loadConfig( const LogLevel& logLevel, const Sizeu& displaySize, bool s FileSystem::dirAddSlashAtEnd( mThemesPath ); #ifndef EE_DEBUG - Log::create( mConfigPath + "ecode.log", logLevel, stdOutLogs, true ); + Log::create( mConfigPath + "ecode.log", logLevel, stdOutLogs, !disableFileLogs ); #else - Log::create( mConfigPath + "ecode.log", logLevel, stdOutLogs, true ); + Log::create( mConfigPath + "ecode.log", logLevel, stdOutLogs, !disableFileLogs ); #endif - if ( disableFileLogs ) - Log::instance()->setLiveWrite( false ); + Log::instance()->setKeepLog( true ); if ( !mArgs.empty() ) { std::string strargs( String::join( mArgs ) ); @@ -3508,6 +3507,7 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe registerUnlockedCommands( *mMainLayout ); mMainLayout->getKeyBindings().addKeybinds( getDefaultKeybindings() ); + Log::instance()->setKeepLog( false ); Log::info( "Complete UI took: %.2f ms", globalClock.getElapsedTime().asMilliseconds() ); #if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN @@ -3607,8 +3607,7 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) { args::Flag benchmarkMode( parser, "benchmark-mode", "Render as much as possible to measure the rendering performance.", { "benchmark-mode" } ); - args::Flag verbose( parser, "verbose", "Print all logs to the standard output.", - { 'v', "verbose" } ); + args::Flag verbose( parser, "verbose", "Redirects all logs to stdout.", { 'v', "verbose" } ); args::Flag version( parser, "version", "Prints version information", { 'V', "version" } ); args::ValueFlag jobs( parser, "jobs", @@ -3644,8 +3643,6 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) { parser, "convert-lang-output", "Sets the directory output path. If not set it will be printed to stdout", { "convert-lang-output" }, "" ); - args::Flag stdOutLogs( parser, "stdout-logs", "Redirects all logs to stdout", - { "stdout-logs" } ); args::Flag disableFileLogs( parser, "disable-file-logs", "Disables writing logs to a log file", { "disable-file-logs" } ); @@ -3710,15 +3707,12 @@ EE_MAIN_FUNC int main( int argc, char* argv[] ) { return EXIT_SUCCESS; } - if ( verbose.Get() ) - Log::instance()->setLogToStdOut( true ); - appInstance = eeNew( App, ( jobs, args ) ); appInstance->init( logLevel.Get(), folder ? folder.Get() : fileOrFolderPos.Get(), pixelDenstiyConf ? pixelDenstiyConf.Get() : 0.f, prefersColorScheme ? prefersColorScheme.Get() : "", terminal.Get(), fb.Get(), benchmarkMode.Get(), css.Get(), health || healthLang, healthLang.Get(), - healthFormat.Get(), file.Get(), stdOutLogs.Get(), disableFileLogs.Get() ); + healthFormat.Get(), file.Get(), verbose.Get(), disableFileLogs.Get() ); eeSAFE_DELETE( appInstance ); Engine::destroySingleton();