Skip to content

Restore valid single-root LogConfig.xml format - #806

Draft
restenb with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-logconfig-xml-format
Draft

Restore valid single-root LogConfig.xml format#806
restenb with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-logconfig-xml-format

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

LogConfig.xml became invalid after adding new observer options because the file ended up with two top-level elements. This change restores a valid XML structure without changing the intended logging configuration behavior.

  • XML format

    • Keep <simulators> as the single document root.
    • Move timestampedFilenames and floatingPointPrecision onto that root as attributes.
  • Observer config parsing

    • Read the new logging options from the <simulators> root element.
    • Preserve existing simulator/variable parsing behavior.
  • Regression coverage

    • Extend the config-based observer test to verify the root-level settings are still applied, including fixed filenames and configured numeric precision.
<simulators
    xmlns="http://opensimulationplatform.com/LogConfig"
    timestampedFilenames="false"
    floatingPointPrecision="1">
    <simulator name="slave" decimationFactor="20">
        <variable name="realOut"/>
        <variable name="intOut"/>
        <variable name="stringOut"/>
    </simulator>
</simulators>

Copilot AI linked an issue Aug 27, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits August 27, 2026 13:40
Co-authored-by: restenb <40600023+restenb@users.noreply.github.com>
Co-authored-by: restenb <40600023+restenb@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix invalid LogConfig.xml format Restore valid single-root LogConfig.xml format Aug 27, 2026
Copilot AI requested a review from restenb August 27, 2026 13:45
@restenb
restenb requested a review from eidekrist August 27, 2026 13:45
@restenb

restenb commented Sep 4, 2026

Copy link
Copy Markdown
Member

@copilot the changes broke one of the tests, investigate the cause and fix this.

Co-authored-by: restenb <40600023+restenb@users.noreply.github.com>

Copilot AI commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot the changes broke one of the tests, investigate the cause and fix this.

Fixed in 9f84fee. The failing assertion was reading slave.csv before the observer had closed/flushed the file, so I updated the test to stop the observer before reading the log file. I also re-ran cpp_file_observer_logging_from_config_test in CI-like shared and static builds, and it passed in both.

@eidekrist eidekrist left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wunderbar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LogConfig.xml format is invalid

3 participants