35 #define NUMBERMAX 9999
36 #define NUMBERFMF "%s\\%s%.04d.LOG"
95 #if SDLOG_ALL_BUFFERS_SIZE == 0 || SDLOG_MAX_MESSAGE_LEN == 0 || \
96 SDLOG_QUEUE_BUCKETS == 0
97 #undef SDLOG_NEED_QUEUE
99 #define SDLOG_NEED_QUEUE
102 #define LOG_PREALLOCATION_ENABLED true
103 #define LOG_PREALLOCATION_DISABLED false
104 #define LOG_APPEND_TAG_AT_CLOSE_ENABLED true
105 #define LOG_APPEND_TAG_AT_CLOSE_DISABLED false
107 #ifdef SDLOG_NEED_QUEUE
108 typedef struct LogMessage LogMessage;
158 char *nextFileName,
const size_t nameLength,
const int indexOffset);
175 const size_t sizeConsideredEmpty);
186 #ifdef SDLOG_NEED_QUEUE
207 SdioError sdLogOpenLog(FileDes *fileObject,
const char *directoryName,
const char *prefix,
208 const uint32_t autoFlushPeriod,
const bool appendTagAtClose,
209 const size_t sizeInMo,
const bool preallocate,
char *fileName,
const size_t nameLength);
221 SdioError sdLogFlushLog(
const FileDes fileObject);
237 SdioError sdLogCloseLog(
const FileDes fileObject);
256 SdioError sdLogWriteLog(
const FileDes fileObject,
const char *fmt, ...)
257 __attribute__ ((format (printf, 2, 3)));;
267 SdioError sdLogWriteRaw(const FileDes fileObject, const
uint8_t *buffer, const
size_t len);
340 size_t sdLogGetNbBytesWrittenToStorage(
void);
SdioError sdLogFinish(void)
unmount filesystem
SdioError getFileName(const char *prefix, const char *directoryName, char *nextFileName, const size_t nameLength, const int indexOffset)
get last used name for a pattern, then add offset and return valid filename
static const float offset[]
SdioError removeEmptyLogs(const char *directoryName, const char *prefix, const size_t sizeConsideredEmpty)
remove spurious log file left on sd
struct _SdLogBuffer SdLogBuffer
SdioError sdLogInit(uint32_t *freeSpaceInKo)
initialise sdLog