Merge pull request #660 from s3fs-fuse/patch

Refixed s3fs_init message(ref #652)
This commit is contained in:
Takeshi Nakatani 2017-10-15 16:01:45 +09:00 committed by GitHub
commit 48e0d55c8e
2 changed files with 9 additions and 1 deletions

View File

@ -100,6 +100,14 @@ enum s3fs_log_level{
syslog(S3FS_LOG_LEVEL_TO_SYSLOG(S3FS_LOG_CRIT), "s3fs: " fmt "%s", __VA_ARGS__); \
}
// Special macro for init message
#define S3FS_PRN_INIT_INFO(fmt, ...) \
if(foreground){ \
fprintf(stdout, "%s%s%s:%s(%d): " fmt "%s\n", S3FS_LOG_LEVEL_STRING(S3FS_LOG_INFO), S3FS_LOG_NEST(0), __FILE__, __func__, __LINE__, __VA_ARGS__, ""); \
}else{ \
syslog(S3FS_LOG_LEVEL_TO_SYSLOG(S3FS_LOG_INFO), "%s" fmt "%s", S3FS_LOG_NEST(0), __VA_ARGS__, ""); \
}
// [NOTE]
// small trick for VA_ARGS
//

View File

@ -3364,7 +3364,7 @@ static void s3fs_exit_fuseloop(int exit_status) {
static void* s3fs_init(struct fuse_conn_info* conn)
{
S3FS_PRN_INFO("init v%s(commit:%s) with %s", VERSION, COMMIT_HASH_VAL, s3fs_crypt_lib_name());
S3FS_PRN_INIT_INFO("init v%s(commit:%s) with %s", VERSION, COMMIT_HASH_VAL, s3fs_crypt_lib_name());
// cache(remove cache dirs at first)
if(is_remove_cache && (!CacheFileStat::DeleteCacheFileStatDirectory() || !FdManager::DeleteCacheDirectory())){