View Single Post
Old 02-16-2020, 06:58 AM
AlexG AlexG is offline
Registered User
Join Date: Jan 2020
Posts: 5
Multiple tabs/logs with time stamps

Need help please.
I am running Python script that opens a few tabs, each to the same IP but different port. Activate log per tab. In addition, want to have time stamp in front of every log’s line.
One option that I may use – is to configure default session with option “on each line” something like “%h-%m” and to use in the script option “crt.Session.LogUsingSessionOptions” which will set per tab default configuration including per line time stamp. However, since I have same IP and different ports per tab, I have no option to have unique log name. I may include Host name (IP) as part of name (%H) and session name %S (which in default session is the same for all tabs), but there is no option to include port as part of name. Therefore, I get a few log files with the same name (including time stamp into log name does not help to distinguish between them). Not sure whether I could change name on later stage, also would help.
Another option that I tried, is to configure each session individually, like:
objTab.Session.Log (False)
objTab.Session.Config.SetOption("Custom Log Message Each Line", "%D_%h_%m")
objTab.Session.LogFileName = strPath + strCaption + "(" + port + ")_%D-%M-%Y-%h_%m_%s.txt"
objTab.Session.Log (True)
I get unique names for log files but no time stamps.
Much appreciate help.
Reply With Quote