Skip to content

Commit

Permalink
Merge pull request #6067 from osalyk/pmemobj_log
Browse files Browse the repository at this point in the history
obj: unify description with implementation pmemobj_log* fun
  • Loading branch information
janekmi authored Apr 2, 2024
2 parents 8d177f1 + 94ebe88 commit 5e319ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 9 additions & 5 deletions src/include/libpmemobj/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ extern "C" {
enum pmemobj_log_level {
/* only basic library info */
PMEMOBJ_LOG_LEVEL_HARK,
/* an error that causes the library to stop working immediately */
/* an error that causes the program to stop working immediately */
PMEMOBJ_LOG_LEVEL_FATAL,
/* an error that causes the library to stop working properly */
/* an error that causes the current operation or transaction to fail */
PMEMOBJ_LOG_LEVEL_ERROR,
/* an errors that could be handled in the upper level */
/*
* an unexpected situation that does NOT cause
* the current operation to fail
*/
PMEMOBJ_LOG_LEVEL_WARNING,
/* non-massive info mainly related to public API function completions */
PMEMOBJ_LOG_LEVEL_NOTICE,
Expand All @@ -36,8 +39,9 @@ enum pmemobj_log_level {

enum pmemobj_log_threshold {
/*
* the main threshold level - the logging messages above this level
* won't trigger the logging functions
* the main threshold level - the logging messages less severe than
* indicated by this threshold's value won't trigger the logging
* functions
*/
PMEMOBJ_LOG_THRESHOLD,
/*
Expand Down
12 changes: 6 additions & 6 deletions src/libpmemobj/obj_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@
#include "util.h"

/*
* pmemobj_log_set_threshold -- set the log level threshold
* pmemobj_log_set_threshold -- set the logging threshold value
*/
int
pmemobj_log_set_threshold(enum pmemobj_log_threshold threshold,
enum pmemobj_log_level level)
enum pmemobj_log_level value)
{
int ret = core_log_set_threshold((enum core_log_threshold)threshold,
(enum core_log_level)level);
(enum core_log_level)value);
return core_log_error_translate(ret);
}

/*
* pmemobj_log_get_threshold -- get the log level threshold
* pmemobj_log_get_threshold -- get the logging value threshold value
*/
int
pmemobj_log_get_threshold(enum pmemobj_log_threshold threshold,
enum pmemobj_log_level *level)
enum pmemobj_log_level *value)
{
int ret = core_log_get_threshold((enum core_log_threshold)threshold,
(enum core_log_level *)level);
(enum core_log_level *)value);
return core_log_error_translate(ret);
}

Expand Down

0 comments on commit 5e319ce

Please sign in to comment.