Browse Source

Bug 1948: Debug information is printed at the end of the scripting session when debug logging level is set even if logging is turned off

https://winscp.net/tracker/1948

Source commit: c46326e83e52349ccc6f037c18a59a85d855e099
Martin Prikryl 4 years ago
parent
commit
069aa20fb3
3 changed files with 5 additions and 5 deletions
  1. 1 1
      source/core/Script.cpp
  2. 1 1
      source/core/SessionInfo.cpp
  3. 3 3
      source/windows/ConsoleRunner.cpp

+ 1 - 1
source/core/Script.cpp

@@ -503,7 +503,7 @@ void __fastcall TScript::Command(UnicodeString Cmd)
         UnicodeString LogCmd = GetLogCmd(FullCmd, Command, Cmd);
         Log(llInput, LogCmd);
 
-        if (Configuration->LogProtocol >= 1)
+        if (Configuration->ActualLogProtocol >= 1)
         {
           UnicodeString DummyLogCmd;
           if (DebugAlwaysTrue(CutToken(LogCmd, DummyLogCmd)))

+ 1 - 1
source/core/SessionInfo.cpp

@@ -1177,7 +1177,7 @@ void __fastcall TSessionLog::DoAddStartupInfo(TSessionData * Data)
     ADF(L"Process ID: %d", (int(GetCurrentProcessId())));
     ADF(L"Parent process: %s", (GetAncestorProcessName()));
     ADF(L"Command-line: %s", (GetCmdLineLog()));
-    if (FConfiguration->LogProtocol >= 1)
+    if (FConfiguration->ActualLogProtocol >= 1)
     {
       AddOptions(GetGlobalOptions());
     }

+ 3 - 3
source/windows/ConsoleRunner.cpp

@@ -657,12 +657,12 @@ void __fastcall TExternalConsole::SendEvent(int Timeout)
 {
   SetEvent(FRequestEvent);
   unsigned int Start = 0; // shut up
-  if (Configuration->LogProtocol >= 1)
+  if (Configuration->ActualLogProtocol >= 1)
   {
     Start = GetTickCount();
   }
   unsigned int Result = WaitForSingleObject(FResponseEvent, Timeout);
-  if (Configuration->LogProtocol >= 1)
+  if (Configuration->ActualLogProtocol >= 1)
   {
     unsigned int End = GetTickCount();
     unsigned int Duration = End - Start;
@@ -2202,7 +2202,7 @@ int __fastcall TConsoleRunner::Run(const UnicodeString Session, TOptions * Optio
     {
       UnicodeString ExitCodeMessage = FORMAT(L"Exit code: %d", (ExitCode));
       FScript->Log(llMessage, ExitCodeMessage);
-      if (Configuration->LogProtocol >= 1)
+      if (Configuration->ActualLogProtocol >= 1)
       {
         FConsole->Print(ExitCodeMessage + L"\n");
         UnicodeString LogMessage = FConsole->FinalLogMessage();