Commands for easy logging

Scripts and programs to automate Astroart
Post Reply
fabdev
Posts: 571
Joined: 03 Dec 2018, 21:43

Commands for easy logging

Post by fabdev » 25 Sep 2025, 14:04

In Astroart 9 SP2 there are two commands for easy logging from your scripts: Log.OK and Log.Error, for example:

Code: Select all

Log.OK("All is working well")
Log.Error("Cannot save image")
will add the following two lines to the log:

Code: Select all

 
02:48:12.310  SCRIPT  All is working well
02:48:12.316  SCRIPT  ********** ERROR ***********  Cannot save image
 
Log files are written automatically in the folder "Log" of the Astroart data folder, (usually in Public Documents, you may change the folder in the Options).
The filename for a given night is (for example): "2025_09_25-26.txt" which means that it's the night between 25 and 26 September. The next one will be: "2025_09_26-27.txt" and so on. Every file starts and ends at noon.
One event is written per row, the format of each row is: Time , Device , Message. For example:

Code: Select all

 
02:48:12.310  SCRIPT  All is working well
02:49:49.647  CAMERA  Image downloaded OK
02:49:51.184  TELESCOPE  Goto 18 03 41 -24 23
02:49:56.771  CAMERA  Binning mode 2
 
Log events for the instrumentation (CAMERA, TELESCOPE, in the example above) must be enabled in the Options of camera control, otherwise only SCRIPT commands will be logged.

Errors are highlighted with: ********** ERROR *********** after the Device name, before the Message.

Post Reply