Skip to content

ConfigManager Documentation

Voidless7125 edited this page Sep 27, 2024 · 3 revisions

ConfigManager Documentation

Methods

getLogToFile()

  • Description: Retrieves the current setting for logging to a file.
  • Return Type: bool
  • Return Value: true if logging to a file is enabled, false otherwise.

setLogToFile(bool logToFile)

  • Description: Sets the configuration for logging to a file.
  • Parameters:
    • logToFile (type: bool): The new setting for logging to a file (true to enable logging, false to disable logging).

Usage

Retrieving the Current Logging Setting

ConfigManager.getLogToFile();

Changing the Logging Setting

ConfigManager.setLogToFile(true); // Enable logging to a file

Example

// Check if logging to a file is enabled

if (ConfigManager.getLogToFile()) {
    // Perform logging to a file (If true)
} else {
    // Do not log to a file
}

Notes

  • The ConfigManager class can be used while the program is running, it does not have to be startup only.
  • Changes made to the configuration settings needs to be saved to a SD card. If there is no SD card, this will not work across reboots of programs.

Clone this wiki locally