Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:38:43

0001 /*
0002  * Copyright (c) CERN 2013-2017
0003  *
0004  * Copyright (c) Members of the EMI Collaboration. 2010-2013
0005  *  See  http://www.eu-emi.eu/partners for details on the copyright
0006  *  holders.
0007  *
0008  * Licensed under the Apache License, Version 2.0 (the "License");
0009  * you may not use this file except in compliance with the License.
0010  * You may obtain a copy of the License at
0011  *
0012  *    http://www.apache.org/licenses/LICENSE-2.0
0013  *
0014  * Unless required by applicable law or agreed to in writing, software
0015  * distributed under the License is distributed on an "AS IS" BASIS,
0016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0017  * See the License for the specific language governing permissions and
0018  * limitations under the License.
0019  */
0020 
0021 #pragma once
0022 #ifndef GFAL_LOGGER_H_
0023 #define GFAL_LOGGER_H_
0024 
0025 #if !defined(__GFAL2_H_INSIDE__) && !defined(__GFAL2_BUILD__)
0026 #   warning "Direct inclusion of gfal2 headers is deprecated. Please, include only gfal_api.h or gfal_plugins_api.h"
0027 #endif
0028 
0029 
0030 #include <glib.h>
0031 #include <common/gfal_deprecated.h>
0032 
0033 
0034 #ifdef __cplusplus
0035 extern "C"
0036 {
0037 #endif
0038 
0039 /**
0040  * Log a message with the given level.
0041  * The default handler prints to stderr.
0042  */
0043 void gfal2_log(GLogLevelFlags level, const char* msg, ...);
0044 
0045 /**
0046  * Log a message with the given level.
0047  * The default handler prints to stderr.
0048  */
0049 void gfal2_logv(GLogLevelFlags level, const char* msg, va_list args);
0050 
0051 
0052 /**
0053  * Set the log level. Only messages with level higher or equal will be passed to the handler.
0054  * For instance, if set to G_LOG_LEVEL_WARNING,
0055  * only messages with level WARNING, CRITICAL and ERROR will be considered.
0056  */
0057 void gfal2_log_set_level(GLogLevelFlags level);
0058 
0059 /**
0060  * Return the log level configured
0061  */
0062 GLogLevelFlags gfal2_log_get_level(void);
0063 
0064 /**
0065  * Set a custom handler
0066  * See Glib2 message logging system for more informations about log_func.
0067  * Internally, gfal2 uses the glib2 log system with the "GFAL2" domain.
0068  * Usual glib2 functions can be used to control the gfal2 messages.
0069  */
0070 int gfal2_log_set_handler(GLogFunc func, gpointer user_data);
0071 
0072 
0073 #ifdef __cplusplus
0074 }
0075 #endif
0076 
0077 #endif /* GFAL_LOGGER_H_ */