I deeply appreciate your time helping me with this.
Here is the relevant (I think) section:
Code:
Select Case bConnected
Case True ' Connected
UserName = env("USERNAME")
UserProf = env("USERPROFILE")
objTab.Caption = strConnectType & strShortHostName
crt.Session.SetStatusText("Connected: " & strConnectType & strShortHostName)
Call CLS
objTab.Session.Log False
Set objConfig = objTab.Session.Config
objConfig.SetOption "Custom Log Message Each Line", "%h:%m:%s | "
objTab.Session.LogFileName = UserProf & "\SecureCRT Logs\" & UserName & "\%Y-%M-%D.%h.%m - " & strShortHostName & " -- (" & UserName & ").log"
objTab.Session.Log True
Case False ' Not Connected
crt.Dialog.MessageBox "Try again later:" & vbCrLf & strShortHostName
End Select
I had "crt.Session" for several lines in there and changed them to "objTab.Session".
Is "objTab.Session.Log True/False" the correct way to toggle logging?
I did an experiment... I did what you did, using the File Menu to Toggle Logging. At that point, the lines are tagged as expected.
So, the way I am trying to enable logging with the script is the culprit.