Debug Message Fix

This commit is contained in:
Maddox Werts 2024-09-05 16:42:59 -04:00
parent 9b42cc862b
commit d580ff5d46

View file

@ -8,13 +8,13 @@ void store_folder_init() {
Storage* storage = furi_record_open(RECORD_STORAGE);
// DEBUG
FURI_LOG_I(TAG, "Creating FlipperPass Folder");
FURI_LOG_D(TAG, "Creating FlipperPass Folder");
// Creating folder
if (storage_simply_mkdir(storage, DIR)) {
FURI_LOG_I(TAG, "Created FPass Directory");
FURI_LOG_D(TAG, "Created FPass Directory");
} else {
FURI_LOG_I(TAG, "FPass Directory already exists");
FURI_LOG_D(TAG, "FPass Directory already exists");
}
// Cleanup
@ -41,6 +41,9 @@ char* store_load(char* type) {
return NULL;
}
// DEBUG
FURI_LOG_D(TAG, "Opening file at %s", PATH);
// Opening file
if (!flipper_format_file_open_existing(_format, PATH)) {
FURI_LOG_E(TAG, "Sorry, please register.");
@ -51,6 +54,9 @@ char* store_load(char* type) {
furi_record_close(RECORD_STORAGE);
return NULL;
}
// DEBUG
FURI_LOG_D(TAG, "Reading data from file...");
// Reading data from file
if (!flipper_format_read_string(_format, type, _data)) {
@ -58,6 +64,9 @@ char* store_load(char* type) {
return NULL;
}
// DEBUG
FURI_LOG_D(TAG, "Copying data into string");
// Copy data into result
const char* _cstr_data = furi_string_get_cstr(_data);
result = malloc(strlen(_cstr_data) + 1);
@ -70,6 +79,9 @@ char* store_load(char* type) {
flipper_format_free(_format);
furi_record_close(RECORD_STORAGE);
// DEBUG
FURI_LOG_D(TAG, "File read successfully");
// Returning result
return result;
}
@ -105,7 +117,7 @@ void store_save(char* type, char* data) {
FURI_LOG_E(TAG, "Failed to write to file at %s", PATH);
return;
} else {
FURI_LOG_I(TAG, "Successfully wrote to file at %s", PATH);
FURI_LOG_D(TAG, "Successfully wrote to file at %s", PATH);
}
// Closing file