Page 1 of 1

How to write log/txt file

Posted: 27 Jul 2016 21:06
by rvtienhoven
Hi Bernd,

I want to create my 'custom' logfile. So, I want to write an rule to an .txt file with an command, so I can choose my own text.
Example:
27-7-2016 21:01:22 - Silence detection has detected an silence of 30 seconds.
27-7-2016 21:05:42 - Silence detection has detected noise again.
27-7-2016 21:06:24 - User Pietje has logged in
27-7-2016 21:50:24 - User Pietje has logged out.

I know that I can write text to an .txt file with the EXEC_WRITE_FILE command. But If I use it, it only stores the line and remove the earlier line. I want to store the new line in the .txt file, but not deleting the other content in the file. How could I do this?


Remi

Re: How to write log/txt file

Posted: 27 Jul 2016 21:36
by radio42
So you can use any event in the system and then use the control-command "EXEC_WRITE_FILE".
E.g.:

Code: Select all

EXEC_WRITE_FILE C:\log\myFile.txt|au|${now} - Silence detection has detected an silence of 30 seconds.
Note: All commands as well as macros are fully listed in the User Manual Appendix.

Re: How to write log/txt file

Posted: 28 Jul 2016 14:06
by rvtienhoven
Yes. But then, all text is saved to each other instead of one text for each line. I want that every single text has his own line, so the file is normal readable.
By the standard playlist logging, every track has its own line. That is what i want...

Re: How to write log/txt file

Posted: 28 Jul 2016 20:33
by radio42
OKay, that was a too simple example, just add the carried return line feed macro to the end of you command, like this:

Code: Select all

EXEC_WRITE_FILE C:\log\myFile.txt|au|${now} - Silence detection has detected an silence of 30 seconds.${CRLF}
or like this

Code: Select all

EXEC_WRITE_FILE C:\log\myFile.txt|au|${now} - Silence detection has detected an silence of 30 seconds.\r\n