Debug Message Fix
This commit is contained in:
parent
9b42cc862b
commit
d580ff5d46
1 changed files with 16 additions and 4 deletions
|
@ -8,13 +8,13 @@ void store_folder_init() {
|
||||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
FURI_LOG_I(TAG, "Creating FlipperPass Folder");
|
FURI_LOG_D(TAG, "Creating FlipperPass Folder");
|
||||||
|
|
||||||
// Creating folder
|
// Creating folder
|
||||||
if (storage_simply_mkdir(storage, DIR)) {
|
if (storage_simply_mkdir(storage, DIR)) {
|
||||||
FURI_LOG_I(TAG, "Created FPass Directory");
|
FURI_LOG_D(TAG, "Created FPass Directory");
|
||||||
} else {
|
} else {
|
||||||
FURI_LOG_I(TAG, "FPass Directory already exists");
|
FURI_LOG_D(TAG, "FPass Directory already exists");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
|
@ -41,6 +41,9 @@ char* store_load(char* type) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
FURI_LOG_D(TAG, "Opening file at %s", PATH);
|
||||||
|
|
||||||
// Opening file
|
// Opening file
|
||||||
if (!flipper_format_file_open_existing(_format, PATH)) {
|
if (!flipper_format_file_open_existing(_format, PATH)) {
|
||||||
FURI_LOG_E(TAG, "Sorry, please register.");
|
FURI_LOG_E(TAG, "Sorry, please register.");
|
||||||
|
@ -52,12 +55,18 @@ char* store_load(char* type) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
FURI_LOG_D(TAG, "Reading data from file...");
|
||||||
|
|
||||||
// Reading data from file
|
// Reading data from file
|
||||||
if (!flipper_format_read_string(_format, type, _data)) {
|
if (!flipper_format_read_string(_format, type, _data)) {
|
||||||
FURI_LOG_E(TAG, "Couldn't read data");
|
FURI_LOG_E(TAG, "Couldn't read data");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
FURI_LOG_D(TAG, "Copying data into string");
|
||||||
|
|
||||||
// Copy data into result
|
// Copy data into result
|
||||||
const char* _cstr_data = furi_string_get_cstr(_data);
|
const char* _cstr_data = furi_string_get_cstr(_data);
|
||||||
result = malloc(strlen(_cstr_data) + 1);
|
result = malloc(strlen(_cstr_data) + 1);
|
||||||
|
@ -70,6 +79,9 @@ char* store_load(char* type) {
|
||||||
flipper_format_free(_format);
|
flipper_format_free(_format);
|
||||||
furi_record_close(RECORD_STORAGE);
|
furi_record_close(RECORD_STORAGE);
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
FURI_LOG_D(TAG, "File read successfully");
|
||||||
|
|
||||||
// Returning result
|
// Returning result
|
||||||
return 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);
|
FURI_LOG_E(TAG, "Failed to write to file at %s", PATH);
|
||||||
return;
|
return;
|
||||||
} else {
|
} 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
|
// Closing file
|
||||||
|
|
Loading…
Reference in a new issue