How to log the output from the multiple telnet sessions to separate log file

manjunatha.mahalingappa at gmail.com manjunatha.mahalingappa at gmail.com
Sat Oct 17 13:25:05 EDT 2015


On Friday, October 16, 2015 at 11:11:58 PM UTC-7, dieter wrote:
> manjunatha.mahalingappa at gmail.com writes:
> > I'm very much new to python. 
> > I'm doing the automation for networking device testing , I will be opening the 4 telnet session, and doing some testing operations on each of those  telnet sessions and capture or log the respective output in 4 different log files.
> 
> Personally, I find it a bit strange that each (telnet) session
> should get its own logfile, but, if that is what you need, I would
> approach it as follows:
> 
>   * define a class "TelnetSession"; create a logger in its "__init__" method;
>     use this logger for all operations inside a "TelnetSession"
> 
>   * instantiate the class "TelnetSession" for each telnet session you
>     want to open.
>     Use those objects method to operate on the sessions.


Hello Dieter,

Thank you so much for the reply and suggestion.. I believe this approch should work for me..!! thanks for your time..


Regards
Manju 



More information about the Python-list mailing list