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
103 #ifdef SDLOG_NEED_QUEUE
104 typedef struct LogMessage LogMessage;
154 char *nextFileName,
const size_t nameLength,
const int indexOffset);
171 const size_t sizeConsideredEmpty);
182 #ifdef SDLOG_NEED_QUEUE
201 SdioError sdLogOpenLog(FileDes *fileObject,
const char *directoryName,
const char *fileName,
202 const uint32_t autoFlushPeriod,
const bool appendTagAtClose,
203 const size_t sizeInMo,
const bool preallocate);
215 SdioError sdLogFlushLog(
const FileDes fileObject);
231 SdioError sdLogCloseLog(
const FileDes fileObject);
250 SdioError sdLogWriteLog(
const FileDes fileObject,
const char *fmt, ...)
251 __attribute__ ((format (printf, 2, 3)));;
261 SdioError sdLogWriteRaw(const FileDes fileObject, const
uint8_t *buffer, const
size_t len);
334 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