Make Git plugin less verbose.

This commit is contained in:
Martín Lucas Golini
2025-04-07 21:16:20 -03:00
parent 22d08d5016
commit 1d2c258ae7
3 changed files with 3 additions and 11 deletions

View File

@@ -47,13 +47,11 @@ int Git::git( const std::string& args, const std::string& projectDir, std::strin
p.readAllStdOut( buf );
int retCode = 0;
p.join( &retCode );
if ( mLogLevel == LogLevel::Info ||
( mLogLevel >= LogLevel::Warning && retCode != EXIT_SUCCESS ) ) {
Log::instance()->writef( mLogLevel, "GitPlugin cmd in %s (%d): %s %s",
if ( !mSilent || retCode != EXIT_SUCCESS ) {
Log::instance()->writef( retCode != EXIT_SUCCESS ? LogLevel::Info : LogLevel::Debug,
"GitPlugin cmd in %s (%d): %s %s",
clock.getElapsedTime().toString(), retCode, mGitPath, args );
}
if ( !mSilent )
Log::debug( "%s", buf );
return retCode;
}

View File

@@ -349,10 +349,6 @@ class Git {
GitStatusReport statusFromShortStatusStr( const std::string_view& statusStr );
void setLogLevel( LogLevel logLevel ) { mLogLevel = logLevel; }
LogLevel getLogLevel() const { return mLogLevel; }
void setSilent( bool set ) { mSilent = set; }
bool isSilent() const { return mSilent; }
@@ -370,7 +366,6 @@ class Git {
std::string mProjectPath;
std::string mGitFolder;
std::vector<std::string> mSubModules;
LogLevel mLogLevel{ LogLevel::Error };
Mutex mSubModulesMutex;
bool mSubModulesUpdated{ false };
bool mSilent{ false };

View File

@@ -230,7 +230,6 @@ void GitPlugin::load( PluginManager* pluginManager ) {
}
mGit = std::make_unique<Git>( pluginManager->getWorkspaceFolder() );
mGit->setLogLevel( Log::instance()->getLogLevelThreshold() );
mGit->setSilent( mSilent );
mGitFound = !mGit->getGitPath().empty();
mProjectPath = mRepoSelected = mGit->getProjectPath();