Introduce crypt_logf and remove logger wrapper.

Export (alredy existing) log function with variable parameter count.
This commit is contained in:
Milan Broz
2020-09-27 11:22:38 +02:00
parent 37188482fe
commit 42f4dcef88
12 changed files with 55 additions and 74 deletions

View File

@@ -48,7 +48,7 @@ int crypt_cli_get_key(const char *prompt,
int timeout, int verify, int pwquality,
struct crypt_device *cd, struct crypt_cli *ctx);
int crypt_cli_read_mk(const char *file, char **key, size_t keysize);
int crypt_cli_read_mk(struct crypt_device *cd, const char *file, char **key, size_t keysize);
bool crypt_cli_arg_set(struct crypt_cli *ctx, const char *name);
@@ -56,15 +56,6 @@ int crypt_cli_arg_value(struct crypt_cli *ctx, const char *name, void *value);
int crypt_cli_arg_type(struct crypt_cli *ctx, const char *name, crypt_arg_type_info *type);
void crypt_cli_logger(struct crypt_device *cd, int level, const char *file, int line,
const char *format, ...);
/* Log */
#define log_dbg(x...) crypt_cli_logger(NULL, CRYPT_LOG_DEBUG, __FILE__, __LINE__, x)
#define log_std(x...) crypt_cli_logger(NULL, CRYPT_LOG_NORMAL, __FILE__, __LINE__, x)
#define log_verbose(x...) crypt_cli_logger(NULL, CRYPT_LOG_VERBOSE, __FILE__, __LINE__, x)
#define log_err(x...) crypt_cli_logger(NULL, CRYPT_LOG_ERROR, __FILE__, __LINE__, x)
#ifdef __cplusplus
}
#endif