.\" Extracted by src2man from /build/rpma-11eW7Q/rpma-1.3.0/src/include/librpma.h .\" Text automatically generated by txt2man .TH rpma_log_set_threshold 3 "29 May 2023" "RPMA" "RPMA Programmer's Manual" .SH NAME \fBrpma_log_set_threshold \fP- set the logging threshold level .SH SYNOPSIS .nf .fam C #include int \fBrpma_log_set_threshold\fP(enum rpma_log_threshold \fIthreshold\fP, enum rpma_log_level \fIlevel\fP); enum rpma_log_level { \fIRPMA_LOG_DISABLED\fP, \fIRPMA_LOG_LEVEL_FATAL\fP, \fIRPMA_LOG_LEVEL_ERROR\fP, \fIRPMA_LOG_LEVEL_WARNING\fP, \fIRPMA_LOG_LEVEL_NOTICE\fP, \fIRPMA_LOG_LEVEL_INFO\fP, \fIRPMA_LOG_LEVEL_DEBUG\fP, }; enum rpma_log_threshold { \fIRPMA_LOG_THRESHOLD\fP, \fIRPMA_LOG_THRESHOLD_AUX\fP, RPMA_LOG_THRESHOLD_MAX }; .fam T .fi .fam T .fi .SH DESCRIPTION \fBrpma_log_set_threshold\fP() sets the logging \fIthreshold\fP \fIlevel\fP. .PP Available thresholds are: .IP \(bu 3 \fIRPMA_LOG_THRESHOLD\fP - the main \fIthreshold\fP used to filter out undesired logging messages. Messages on a higher \fIlevel\fP than the primary \fIthreshold\fP \fIlevel\fP are ignored. \fIRPMA_LOG_DISABLED\fP shall be used to suppress logging. The default value is RPMA_LOG_WARNING. .IP \(bu 3 \fIRPMA_LOG_THRESHOLD_AUX\fP - the auxiliary \fIthreshold\fP intended for use inside the logging function (please see \fBrpma_log_get_threshold\fP(3)). The logging function may or may not take this \fIthreshold\fP into consideration. The default value is \fIRPMA_LOG_DISABLED\fP. .PP Available \fIthreshold\fP levels are defined by enum rpma_log_level: .IP \(bu 3 \fIRPMA_LOG_DISABLED\fP - all messages will be suppressed .IP \(bu 3 \fIRPMA_LOG_LEVEL_FATAL\fP - an error that causes the library to stop working immediately .IP \(bu 3 \fIRPMA_LOG_LEVEL_ERROR\fP - an error that causes the library to stop working properly .IP \(bu 3 \fIRPMA_LOG_LEVEL_WARNING\fP - an error that could be handled in the upper \fIlevel\fP .IP \(bu 3 \fIRPMA_LOG_LEVEL_NOTICE\fP - non-massive info mainly related to public API function completions e.g. connection established .IP \(bu 3 \fIRPMA_LOG_LEVEL_INFO\fP - massive info e.g. every write operation indication .IP \(bu 3 \fIRPMA_LOG_LEVEL_DEBUG\fP - debug info e.g. write operation dump .SH THE DEFAULT LOGGING FUNCTION The default logging function writes messages to \fBsyslog\fP(3) and to \fBstderr\fP(3), where \fBsyslog\fP(3) is the primary destination (\fIRPMA_LOG_THRESHOLD\fP applies) whereas \fBstderr\fP(3) is the secondary destination (\fIRPMA_LOG_THRESHOLD_AUX\fP applies). .SH RETURN VALUE \fBrpma_log_syslog_set_threshold\fP() function returns 0 on success or a negative error code on failure. .SH ERRORS \fBrpma_log_set_threshold\fP() can fail with the following errors: .IP \(bu 3 RPMA_E_INVAL - \fIthreshold\fP is not \fIRPMA_LOG_THRESHOLD\fP nor \fIRPMA_LOG_THRESHOLD_AUX\fP .IP \(bu 3 RPMA_E_INVAL - \fIlevel\fP is not a value defined by enum rpma_log_level type .IP \(bu 3 RPMA_E_AGAIN - a temporary error occurred, the retry may fix the problem .SH SEE ALSO \fBrpma_log_get_threshold\fP(3), \fBrpma_log_set_function\fP(3), \fBlibrpma\fP(7) and https://pmem.io/rpma/