Sign in to follow this  
Followers 0
supadodger

write a whole script to log file?

16 posts in this topic

is it possible to write a whole script to a log file?

so you can see exactly what its doing like trayicondebug but without going to every line and creating a filewrite

Share this post


Link to post
Share on other sites



#include <debug.au3>

It's built-in now

Hope that can help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#include <debug.au3>

It's built-in now

Hope that can help

8)

im a little lost.

i need filewriteline("mylogfile.log",debugreport())

something like that...

ive had 1 too many bottles of wine but i know i am close...

Share this post


Link to post
Share on other sites

glasses of wine...

glasses not bottles LOL

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You are going to have to write something from where you want to get info from.

If you dont want to use the standard UDF then write your own debug function, and have it report from each of your script functions.

Or use @error in each function.

EDIT:

For instance

Func _MyFunc()
;.... MyCode
ConsoleWrite("Exited from _MyFunc() with error: " & @error)
Return
EndFunc
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

In SciTE I use Tools > Trace: Add Trace Lines

It will output to the console however.

To remove: Tools > Trace: Remove ALL Trace Lines

Even better ^^^

Never even seen that, I miss so much in scite, because there is so much.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

JohnOne,

Just put #AutoIt3Wrapper_Run_Debug_Mode=Y at the top of the script - but be prepared for a very long scroll through the output pane!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Even better ^^^

Never even seen that, I miss so much in scite, because there is so much.

this worked great because i changed all the consolewrites to filewrite ;)

THANK YOU.

i should have stopped working on my script last night after i felt the buzz but i was so close to finishing and then at some point i couldnt figure out why it was stuck in an infinite loop only when compiled...

Share this post


Link to post
Share on other sites

even better ^^^

i need it to a log file not console though...

Share this post


Link to post
Share on other sites

supadodger,

This will copy the contents of the SciTE output pane to a file - will that do? ;)

#AutoIt3Wrapper_Run_Debug_Mode=Y

#include <GUIConstantsEx.au3>

OnAutoItExitRegister("_Copy_SciTE")

$hGUI = GUICreate("Test", 500, 500)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _Copy_SciTE()

    Local $hSciTE_Wnd = WinGetHandle("[CLASS:SciTEWindow]")
    $sText = ControlGetText($hSciTE_Wnd, "", "[CLASS:Scintilla; INSTANCE:2]")
    $sText = StringToBinary($sText ,2)
    $sText = BinaryToString($sText, 1)
    $sText = String($sText)

    $hFile = FileOpen(@ScriptDir & "\SciTE_Outout.txt", 2)
    FileWrite($hFile, $sText)
    FileClose($hFile)

EndFunc

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

supadodger,

This will copy the contents of the SciTE output pane to a file - will that do? ;)

#AutoIt3Wrapper_Run_Debug_Mode=Y

#include <GUIConstantsEx.au3>

OnAutoItExitRegister("_Copy_SciTE")

$hGUI = GUICreate("Test", 500, 500)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _Copy_SciTE()

    Local $hSciTE_Wnd = WinGetHandle("[CLASS:SciTEWindow]")
    $sText = ControlGetText($hSciTE_Wnd, "", "[CLASS:Scintilla; INSTANCE:2]")
    $sText = StringToBinary($sText ,2)
    $sText = BinaryToString($sText, 1)
    $sText = String($sText)

    $hFile = FileOpen(@ScriptDir & "\SciTE_Outout.txt", 2)
    FileWrite($hFile, $sText)
    FileClose($hFile)

EndFunc

M23

i got it using the trace feature of scite and then search & replace all the consolewrites with filewrites but i will save this thread for future use...

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  
Followers 0