wolkenloser Posted February 25, 2006 Share Posted February 25, 2006 Hi, I´ve written a Script with many functions to inventory some PC's by a loginprocess. But now sometimes a funktion hung for too many seconds, but I don't know why! So. I want to write a debug log witch logs every autoit command by adding a timestamp every line. Is is possible to create a logfile for every Command?? I can't see the Debuginfo by "Opt("TrayIconDebug", 1)" because it runs while the loginprocess. At this moment the traybar is not visible jet. What I need, is a function that writes the Lines to a logfile witch normaly generatet to the trayicon by using "Opt("TrayIconDebug", 1)" Example I want to log the following Function Func FTP_PUT() $server = '100.100.100.100' $username = 'test' $pass = 'test' $Open = _FTPOpen('FTP Inventarisierung') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, $AUSGABEFILE, $NAMEFILE) $Ftpc = _FTPClose($Open) EndFunc The Logfile should look like this The Date Format for the logfile; yyyy.mm.dd.hh.mm.ss 2006.02.25.07.44.02-> $server = '100.100.100.100' 2006.02.25.07.44.03-> $username = 'test' 2006.02.25.07.44.03-> $pass = 'test' 2006.02.25.07.44.03-> $Open = _FTPOpen('FTP Inventarisierung') 2006.02.25.07.44.05-> $Conn = _FTPConnect($Open, $server, $username, $pass) 2006.02.25.07.44.05-> $Ftpp = _FtpPutFile($Conn, $AUSGABEFILE, $NAMEFILE) 2006.02.25.07.44.07-> $Ftpc = _FTPClose($Open) I hope You can help me Wolke Link to comment Share on other sites More sharing options...
GaryFrost Posted February 25, 2006 Share Posted February 25, 2006 Far as I know there is no switch/flag to turn on logging for every command, so if you want to log each line you'll have to put the log commands in i.e. #include <file.au3> ; Func FTP_PUT() $server = '100.100.100.100' _FileWriteLog(@ScriptDir & "\my.log","$server = " & $server) $username = 'test' _FileWriteLog(@ScriptDir & "\my.log","$username = " & $username) $pass = 'test' _FileWriteLog(@ScriptDir & "\my.log","$pass = " & $pass) $Open = _FTPOpen('FTP Inventarisierung') _FileWriteLog(@ScriptDir & "\my.log","$Open = _FTPOpen('FTP Inventarisierung')") $Conn = _FTPConnect($Open, $server, $username, $pass) _FileWriteLog(@ScriptDir & "\my.log","$Conn = _FTPConnect($Open, $server, $username, $pass)") $Ftpp = _FtpPutFile($Conn, $AUSGABEFILE, $NAMEFILE) _FileWriteLog(@ScriptDir & "\my.log","$Ftpp = _FtpPutFile($Conn, $AUSGABEFILE, $NAMEFILE)") $Ftpc = _FTPClose($Open) _FileWriteLog(@ScriptDir & "\my.log","$Ftpc = _FTPClose($Open)") EndFunc SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
wolkenloser Posted February 25, 2006 Author Share Posted February 25, 2006 Hi, Sorry, that's way is not like autoit :-( My Script includes more then 1000 lines (fuzzyjob) I' shure someone knows an other way to get the Information. Please let me know it regards Wolke Link to comment Share on other sites More sharing options...
mikeytown2 Posted February 25, 2006 Share Posted February 25, 2006 one idea would be to read the au3 file in an array and then use the command line option to execute every commandFunc AutoItExecute($Cmd) RunWait(@AutoItExe & ' /AutoIt3ExecuteLine "' & $Cmd & '"') EndFuncand then you have it write the line that it ran and give a time stamp in the file (_FileWriteLog). I don't know how well this will work for functions and things like that though... what your asking for is not that easy. it would have to be some sort of debug program. Another thing is, you could use auto it to populate the the _FileWriteLog line in your au3 file. just an idea since you have 1000's lines of code. you could also play with ConsoleWrite. if your a hacker you could look into the mem functions as well. Good Luck, you will need it! Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now