Jump to content
Sign in to follow this  
damon

Create a Log file using the output of trace Lines

Recommended Posts

damon

I hope I did not miss it anywhere. I have looked and searched the help file and this forum board without any results.

Here is what I need to do. I have a 3200 Line script that I would like to output a *.log file.

I want it to output to a file like the Trace Lines do, with the same or more output options. I would like to know if there is a way to output it as the line is being read so that if something crashes I can look at the log file to find out were it stopped.

Is there a global option or will I have to add something like a filewrite() to every line in my script?


It always amazes me how one little thing can cause so much havoc

Share this post


Link to post
Share on other sites
MrMitchell

Try and how this works for you:

Opt("TrayIconDebug",1)

If enabled shows the current script line in the tray icon tip to help debugging.

0 = no debug information (default)

1 = show debug

Edit: Shoot, nevermind, you want a log output. Sorry!

Edited by MrMitchell

Share this post


Link to post
Share on other sites
damon

thats my problem to, I can not figure out how to write it to a file.

I tried

#include <Debug.au3>

_DebugSetup ("Uninstall",true, 2,@ScriptDir & "\uninstall.log")

but it did not do anything. now this was insertedin the begining of my code after adding trace to all my lines.

If I understand the _debugsetup correctly then "Uninstall" is the heading of the file, 2 -- means it is looking for ConsoleWrite, and "\uninstall.log" is the file I want it to write to.

being that it does not work I assume that I do not understand the _debugsetup or it will not do what I want it to do.


It always amazes me how one little thing can cause so much havoc

Share this post


Link to post
Share on other sites
damon

Ok, I tryied this

#include <Debug.au3>

_DebugSetup ("Uninstall",true, 4,@ScriptDir & "\uninstall.log")

It created the uninstall.log but the only thing in it is\

AutoIt:3.3.6.1 (Os:WIN_XP/X86/Service Pack 3 Language:0409 Keyboard:00000409 Cpu:X64)

I am assuming that it wrote to the uninstall file because I changed 3-to-4, but how do i get it to use the consolewrite as what is input into the uninstall.log file?

Edited by damon

It always amazes me how one little thing can cause so much havoc

Share this post


Link to post
Share on other sites
PsaltyDS

...will I have to add something like a filewrite() to every line in my script?

Yes, at least wherever you want logging to occur.

I prefer _FileWriteLog(), as it adds a time stamp to every entry.

:idea:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
jchd

Try a search fo AutoIt debugger in the Example Scripts forum. May help you.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.