/*1* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#ifndef OSSL_APPS_LOG_H10# define OSSL_APPS_LOG_H1112# include <openssl/bio.h>13# if !defined(OPENSSL_SYS_VMS) && !defined(OPENSSL_SYS_WINDOWS) \14&& !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_POSIX_IO)15# include <syslog.h>16# else17# define LOG_EMERG 018# define LOG_ALERT 119# define LOG_CRIT 220# define LOG_ERR 321# define LOG_WARNING 422# define LOG_NOTICE 523# define LOG_INFO 624# define LOG_DEBUG 725# endif2627# undef LOG_TRACE28# define LOG_TRACE (LOG_DEBUG + 1)2930int log_set_verbosity(const char *prog, int level);31int log_get_verbosity(void);3233/*-34* Output a message using the trace API with the given category35* if the category is >= 0 and tracing is enabled.36* Log the message to syslog if multi-threaded HTTP_DAEMON, else to bio_err37* if the verbosity is sufficient for the given level of severity.38* Yet cannot do both types of output in strict ANSI mode.39* category: trace category as defined in trace.h, or -140* prog: the name of the current app, or NULL41* level: the severity of the message, e.g., LOG_ERR42* fmt: message format, which should not include a trailing newline43* ...: potential extra parameters like with printf()44* returns nothing45*/46void trace_log_message(int category,47const char *prog, int level, const char *fmt, ...);4849#endif /* OSSL_APPS_LOG_H */505152