We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using an debug initialization file in which i have written SLOG >>E:\jyoti_AceUnit\test_projects\aceunit_logging_fullplainlogger\Samsung_with_AceUnit\OUT.TXT
using this a file out.txt is getting opened automatically but nothing is written, i have to manually use SLOG OFF and then the file contains the desired output.
But if i use the same function within the debug INIT file with SLOG >>E:\jyoti_AceUnit\test_projects\aceunit_logging_fullplainlogger\Samsung_with_AceUnit\OUT.TXT SLOG OFF
Nothing is getting stored in a file since serial logger gets closed as soon as it is opened
any option how to automate the opening and logging of a file using SLOG and SLOG OFF commands
"i have to manually use SLOG OFF and then the file contains the desired output."
Presumably, uVision "buffers" the data internally until the file is closed?
"Nothing is getting stored in a file since serial logger gets closed as soon as it is opened"
So don't do that, then!
"how to automate the opening and logging of a file using SLOG and SLOG OFF commands"
You need to model the same as you do manually which is, presumably:
1. SLOG ON 2. run the test 3. SLOG OFF
ya i need to automatically open a file using SLOG, store the serial window data in a file and then close the file using SLOG OFF.
whats happening currently is 1.> SLOG 2> Manually needs to type SLOG OFF in keil command window 3> then file getting modified
Is there any way to automate the second step... since when i use it in a same initialization file nothing is getting stored in a file and is getting closed
You must run the SLOG OFF command _after_ the program has produced the serial data, which means just adding it directly to the script that starts the logging isn't going to work.
Can you use the debug functionality to run SLOG OFF after a specific number of seconds or cycles?
You are talking about some automated tests - but what is synchronizing your tests in the first place? When is it time to start the next test? Or to maybe exit the IDE?
After all - if your test program takes 10 seconds to run and produce the test output, then you must delay the SLOG OFF at least 10 seconds. If it takes 10 ms then you must wait at least 10 ms.
It is common behaviour that programs are using buffered output and not flushing the data after every single text line. Flushing to disk is an extremely (!) slow operation and there is no way the debugger will be able to keep up if it has to flush 10k lines individually.
yes even i thought that if i can delay SLOG OFF command for sometime after SLOG command, but how to do that i am not aware of in a initialization file. If u can help me with that i can try to work with that option
_sleep_(10); for giving delay in initialization function but still the file is not getting logged in any other solution for using SLOG and SLOG OFF in init file
thanks in advance