View Single Post
  #6  
Old 10-27-2020, 10:20 PM
Rhudi's Avatar
Rhudi Rhudi is offline
Registered User
 
Join Date: Jul 2013
Location: Greenville, SC
Posts: 92
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.

Last edited by Rhudi; 10-27-2020 at 10:23 PM. Reason: Additional info