s2e-core
s2e-core copied to clipboard
Refactor logger class impl with std::filesystem
Related issues
N/A
Description
- Refactor
Logger
class with C++17std::filesystem
- Reduce
#ifdef
for platform support - Reduce file path parsing by own (It is very hard to support all platforms correctory)
- Reduce
- Fixes
Logger
does not dump log files iflogs
directory does not exist- FYI: use std::filesystem::create_directories instead of std::filesystem::create_directory
Test results
logger directory & log files creation test
$ rm -rf data/sample/logs # to test logs directory creation
$ cmake -B build
$ cmake --build build
$ mkdir build/hoge
$ cd build/hoge
$ ../S2E
$ cd ../../
$ ls data/sample/logs
logs_240219_172539
$ ls data/sample/logs/logs_240219_172539/ # test logs dir files were created
240219_172539_default.csv gnss_receiver.ini magnetorquer.ini sample_satellite.ini sun_sensor.ini
angular_velocity_observer.ini ground_station_antenna.ini reaction_wheel.ini sample_simulation_base.ini thruster.ini
attitude_observer.ini ground_station_calculator.ini sample_disturbance.ini sample_structure.ini torque_generator.ini
component_interference.ini gyro_sensor.ini sample_ground_station.ini spacecraft_antenna.ini
force_generator.ini magnetometer.ini sample_local_environment.ini star_sensor.ini
Impact
-
Logger
class implementation -
Logger
class interface-
std::string
&std::filesystem::path
can be converted, so the actual change cost is very small
-
修正提案ありがとうございます。ただ、Major Update v8.0.0に関するPRが溜まっており、レビューが進んでいない状況です。
こちらはissueにも立てられておらず、優先度は下げて良いという認識ですので、v8.1.0のマイルストーンに回し他を優先するということでよいでしょうか。
@200km ありがとうございます.これは互換性のある Logger class 内部のみに収まるリファクタなので,それで構わないです.