Tweaked debug output
- Changed "No more free space" to be an error as suggested by davidefer - Tweaked output to be more parsable (no space between lfs and warn)
This commit is contained in:
@@ -471,7 +471,7 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) {
|
|||||||
|
|
||||||
// check if we have looked at all blocks since last ack
|
// check if we have looked at all blocks since last ack
|
||||||
if (lfs->free.ack == 0) {
|
if (lfs->free.ack == 0) {
|
||||||
LFS_WARN("No more free space %"PRIu32,
|
LFS_ERROR("No more free space %"PRIu32,
|
||||||
lfs->free.i + lfs->free.off);
|
lfs->free.i + lfs->free.off);
|
||||||
return LFS_ERR_NOSPC;
|
return LFS_ERR_NOSPC;
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -51,28 +51,28 @@ extern "C"
|
|||||||
// Logging functions
|
// Logging functions
|
||||||
#ifdef LFS_YES_TRACE
|
#ifdef LFS_YES_TRACE
|
||||||
#define LFS_TRACE(fmt, ...) \
|
#define LFS_TRACE(fmt, ...) \
|
||||||
printf("lfs trace:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
printf("lfs_trace:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define LFS_TRACE(fmt, ...)
|
#define LFS_TRACE(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LFS_NO_DEBUG
|
#ifndef LFS_NO_DEBUG
|
||||||
#define LFS_DEBUG(fmt, ...) \
|
#define LFS_DEBUG(fmt, ...) \
|
||||||
printf("lfs debug:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
printf("lfs_debug:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define LFS_DEBUG(fmt, ...)
|
#define LFS_DEBUG(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LFS_NO_WARN
|
#ifndef LFS_NO_WARN
|
||||||
#define LFS_WARN(fmt, ...) \
|
#define LFS_WARN(fmt, ...) \
|
||||||
printf("lfs warn:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
printf("lfs_warn:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define LFS_WARN(fmt, ...)
|
#define LFS_WARN(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef LFS_NO_ERROR
|
#ifndef LFS_NO_ERROR
|
||||||
#define LFS_ERROR(fmt, ...) \
|
#define LFS_ERROR(fmt, ...) \
|
||||||
printf("lfs error:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
printf("lfs_error:%d: " fmt "\n", __LINE__, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define LFS_ERROR(fmt, ...)
|
#define LFS_ERROR(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user