This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SLOG and SLOG OFF

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

Parents
  • 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.

Reply
  • 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.

Children