05-19-2023 11:44 PM
Hi,
How can I write DIAdem error log information on text file saved on user defined location?
Whenever I run a particular script, wants to save a separate error log file, related to this script on a new text file and save it on a defined location. Log file should contain errors related to running that particular script alone.
regards,
Durai
Solved! Go to Solution.
05-26-2023 09:21 AM
Hi Durai26,
you can use TextFileOpen() with the attribute "eTextFileAttributeLogDIAdemMsg". DIAdem then writes the logfile entries additionally into this file.
Greetings,
DIAdemo
06-02-2023 08:05 AM
Hi,
Thanks for your reply.
I am not much familiar with this scripting. can you share some lines to get a copy of DIAdem log file saved in user directory.
Our diadem runs multiple scripts. There is a master file which in turn runs multiple sub files. want to capture the overall log information on external text file. Since multiple scripts files are involved, Intention is to know on which file and what was the error.
thanks in advance for your support.
regards,
Durai
06-02-2023 09:49 AM
Hello Durai,
here is a small example of how to do it.
I hope this helps you.
Greetings
DIAdemo
'-------------------------------------------------------------------------------
Option Explicit 'Forces the explicit declaration of all the variables in a script.
Dim MyFileHandle
MyFileHandle = TextFileOpen("C:\temp\DIAdem_Testlog.txt", TfCreate or TfWrite or TfDenynone or tfLogDIAdemMsg )
TextfileWriteLn MyFileHandle,"This is how you write directly to your log file."
Logfilewrite "Outputs to the DIAdem log file are also written to your log file."
on error resume next ' Suppress abort due to error
r1 = "ABC" ' This is an error, it also appears in the log file.
TextfileWriteLn MyFileHandle,"It's as simple as that."
TextFileClose(MyFileHandle)