-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #362 from MissouriMRDT/topic/cleanup
Cleanup GitHub Actions and Testing Framework
- Loading branch information
Showing
11 changed files
with
213 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -166,4 +166,4 @@ jobs: | |
if: always() | ||
run: | | ||
cd /opt | ||
rm -rf /opt/Autonomy_Software | ||
rm -rf /opt/Autonomy_Software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ bytem | |
byteswap | ||
CAFFE | ||
CALIB | ||
carryforward | ||
CELLVOLTAGE | ||
charconv | ||
chromaprint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,30 +55,15 @@ namespace logging | |
* @author Eli Byrd ([email protected]) | ||
* @date 2023-08-22 | ||
******************************************************************************/ | ||
void InitializeLoggers(std::string szLoggingOutputPath) | ||
void InitializeLoggers(std::string szLoggingOutputPath, std::string szProgramTimeLogsDir) | ||
{ | ||
// Retrieve the current time for the log file name | ||
std::chrono::time_point<std::chrono::system_clock> tmCurrentTime = std::chrono::system_clock::now(); | ||
std::time_t tCurrentTime = std::chrono::system_clock::to_time_t(tmCurrentTime); | ||
|
||
// Convert time to local time | ||
std::tm* tLocalTime = std::localtime(&tCurrentTime); | ||
|
||
// Format the current time in a format that can be used as a file name. | ||
std::array<char, 80> cCurrentTime; | ||
size_t siTimeCharacters; | ||
siTimeCharacters = std::strftime(cCurrentTime.data(), cCurrentTime.size(), "%Y%m%d-%H%M%S", tLocalTime); | ||
if (siTimeCharacters == 0) | ||
{ | ||
std::cerr << "Unable to format calendar date & time (exceeds string length)" << std::endl; | ||
} | ||
// Store start time string in member variable. | ||
g_szProgramStartTimeString = cCurrentTime.data(); | ||
g_szProgramStartTimeString = szProgramTimeLogsDir; | ||
|
||
// Assemble filepath string. | ||
std::filesystem::path szFilePath; | ||
std::filesystem::path szFilename; | ||
szFilePath = szLoggingOutputPath + "/"; // Main location for all recordings. | ||
szFilePath = szLoggingOutputPath; // Main location for all recordings. | ||
szFilePath += g_szProgramStartTimeString + "/"; // Folder for each program run. | ||
szFilename = "console_output"; // Base file name. | ||
|
||
|
@@ -126,22 +111,26 @@ namespace logging | |
szFullOutputPath.replace_extension(".log"), // Log Output Path | ||
[]() | ||
{ | ||
return quill::RotatingFileSinkConfig(); // Rotating File Sink Configs | ||
quill::RotatingFileSinkConfig cfg; | ||
cfg.set_open_mode('a'); | ||
return cfg; // Rotating File Sink Configs | ||
}(), | ||
szLogFilePattern, // Log Output Pattern | ||
szTimestampPattern, // Log Timestamp Pattern | ||
quill::Timezone::LocalTime // Log Timezone | ||
szLogFilePattern, // Log Output Pattern | ||
szTimestampPattern, // Log Timestamp Pattern | ||
quill::Timezone::LocalTime // Log Timezone | ||
); | ||
|
||
std::shared_ptr<quill::Sink> qCSVFileSink = quill::Frontend::create_or_get_sink<MRDTRotatingFileSink>( | ||
szFullOutputPath.replace_extension(".csv"), // Log Output Path | ||
[]() | ||
{ | ||
return quill::RotatingFileSinkConfig(); // Rotating File Sink Configs | ||
quill::RotatingFileSinkConfig cfg; | ||
cfg.set_open_mode('a'); | ||
return cfg; // Rotating File Sink Configs | ||
}(), | ||
szCSVFilePattern, // Log Output Pattern | ||
szTimestampPattern, // Log Timestamp Pattern | ||
quill::Timezone::LocalTime // Log Timezone | ||
szCSVFilePattern, // Log Output Pattern | ||
szTimestampPattern, // Log Timestamp Pattern | ||
quill::Timezone::LocalTime // Log Timezone | ||
); | ||
|
||
std::shared_ptr<quill::Sink> qConsoleSink = quill::Frontend::create_or_get_sink<MRDTConsoleSink>("ConsoleSink", // Log Name | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/****************************************************************************** | ||
* @brief Defines and implements functions related to operations on time and | ||
* date within the timeops namespace. | ||
* | ||
* @file TimeOperations.hpp | ||
* @author Eli Byrd ([email protected]) | ||
* @date 2025-01-07 | ||
* | ||
* @copyright Copyright Mars Rover Design Team 2025 - All Rights Reserved | ||
******************************************************************************/ | ||
|
||
#ifndef TIME_OPERATIONS_HPP | ||
#define TIME_OPERATIONS_HPP | ||
|
||
/// \cond | ||
#include <chrono> | ||
#include <ctime> | ||
#include <iostream> | ||
|
||
/// \endcond | ||
|
||
/****************************************************************************** | ||
* @brief Namespace containing functions related to operations on time and | ||
* date related data types. | ||
* | ||
* @author Eli Byrd ([email protected]) | ||
* @date 2025-01-07 | ||
******************************************************************************/ | ||
namespace timeops | ||
{ | ||
/****************************************************************************** | ||
* @brief Accessor for getting the current time in a specified format. | ||
* | ||
* @param szFormat - The format to return the time in. | ||
* @return std::string - The current time in the specified format. | ||
* | ||
* @author Eli Byrd ([email protected]) | ||
* @date 2025-01-07 | ||
******************************************************************************/ | ||
inline std::string GetTimestamp(std::string szFormat = "%Y%m%d-%H%M%S") | ||
{ | ||
// Retrieve the current time for the log file name | ||
std::chrono::time_point<std::chrono::system_clock> tmCurrentTime = std::chrono::system_clock::now(); | ||
std::time_t tCurrentTime = std::chrono::system_clock::to_time_t(tmCurrentTime); | ||
|
||
// Convert time to local time | ||
std::tm* tLocalTime = std::localtime(&tCurrentTime); | ||
|
||
// Format the current time in a format that can be used as a file name. | ||
std::array<char, 80> cCurrentTime; | ||
size_t siTimeCharacters; | ||
siTimeCharacters = std::strftime(cCurrentTime.data(), cCurrentTime.size(), szFormat.c_str(), tLocalTime); | ||
if (siTimeCharacters == 0) | ||
{ | ||
std::cerr << "Unable to format calendar date & time (exceeds string length)" << std::endl; | ||
} | ||
|
||
return cCurrentTime.data(); | ||
} | ||
} // namespace timeops | ||
|
||
#endif // TIME_OPERATIONS_HPP |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.