Jelajahi Sumber

Optimizing logging

Source commit: bfdd7722519a91a6391d90259e65c818c916ddd8
Martin Prikryl 5 tahun lalu
induk
melakukan
55b14bfe93

+ 3 - 1
source/core/Configuration.cpp

@@ -43,6 +43,8 @@ const UnicodeString DirectoryStatisticsCacheKey(L"DirectoryStatisticsCache");
 const UnicodeString CDCacheKey(L"CDCache");
 const UnicodeString BannersKey(L"Banners");
 //---------------------------------------------------------------------------
+const int BelowNormalLogLevels = 1;
+//---------------------------------------------------------------------------
 __fastcall TConfiguration::TConfiguration()
 {
   FCriticalSection = new TCriticalSection();
@@ -1737,7 +1739,7 @@ bool __fastcall TConfiguration::GetLogToFile()
 //---------------------------------------------------------------------
 void __fastcall TConfiguration::UpdateActualLogProtocol()
 {
-  FActualLogProtocol = FLogging ? FLogProtocol : 0;
+  FActualLogProtocol = FLogging ? FLogProtocol : (-BelowNormalLogLevels - 1);
 }
 //---------------------------------------------------------------------
 void __fastcall TConfiguration::SetLogProtocol(int value)

+ 2 - 0
source/core/Configuration.h

@@ -372,4 +372,6 @@ extern const UnicodeString TlsFingerprintType;
 extern const UnicodeString FtpsCertificateStorageKey;
 extern const UnicodeString HttpsCertificateStorageKey;
 //---------------------------------------------------------------------------
+extern const int BelowNormalLogLevels;
+//---------------------------------------------------------------------------
 #endif

+ 0 - 2
source/forms/Preferences.cpp

@@ -33,8 +33,6 @@
 #pragma link "PathLabel"
 #pragma resource "*.dfm"
 //---------------------------------------------------------------------
-const int BelowNormalLogLevels = 1;
-//---------------------------------------------------------------------
 bool __fastcall DoPreferencesDialog(TPreferencesMode APreferencesMode,
   TPreferencesDialogData * DialogData)
 {