Jump to content

How do I creeat log file using autoIt?


blender
 Share

Recommended Posts

Hi, All

My goal is to create a log file and log events while the script is running. I tried using FileWrite. But I found it won't write to the file until the script finishes running. So if my autoit script hangs, there will be nothing in my log file. I could use fileopen and fileClose to make it write the file. But this way, my script will have many redundant lines of code (fileOpen->FileWrite->FileClose->FileOpen->Filewrite->FileClose....).

So is there a way to create a log file using autoit and make it write stuff to the file at real time without closing the file?

Thanks!

Link to comment
Share on other sites

  • Developers

Just use the FileWriteLine("Filename", text) which will append each record to the file and close it or _FileWriteLog() udf

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...