gmerlin
log.h
1/*****************************************************************
2 * gmerlin - a general purpose multimedia framework and applications
3 *
4 * Copyright (c) 2001 - 2012 Members of the Gmerlin project
5 * gmerlin-general@lists.sourceforge.net
6 * http://gmerlin.sourceforge.net
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * *****************************************************************/
21
22#ifndef __BG_LOG_H_
23#define __BG_LOG_H_
24
25/* Gmerlin log facilities */
26
27#include <gmerlin/parameter.h>
28#include <gmerlin/msgqueue.h>
29
30#include <libintl.h>
31
51typedef enum
52 {
53 BG_LOG_DEBUG = 1<<0,
55 BG_LOG_ERROR = 1<<2,
56 BG_LOG_INFO = 1<<3
58
59#define BG_LOG_LEVEL_MAX (1<<3)
60
75void bg_log_notranslate(bg_log_level_t level, const char * domain,
76 const char * format, ...) __attribute__ ((format (printf, 3, 4)));
77
92void bg_logs_notranslate(bg_log_level_t level, const char * domain,
93 const char * str);
94
95
96
112void bg_log_translate(const char * translation_domain,
113 bg_log_level_t level, const char * domain,
114 const char * format, ...) __attribute__ ((format (printf, 4, 5)));
115
120#define bg_log(level, domain, ...) \
121 bg_log_translate(PACKAGE, level, domain, __VA_ARGS__)
122
123
140
148
157void bg_log_set_verbose(int mask);
158
171
172int bg_log_get_verbose_level();
173
174
184
190void bg_log_syslog_init(const char * name);
191
197const char * bg_log_syslog_name();
198
204// void bg_log_syslog_flush();
205
206
207
208#endif // __BG_LOG_H_
void bg_log_notranslate(bg_log_level_t level, const char *domain, const char *format,...) __attribute__((format(printf
Send a message to the logger without translating it.
const char * bg_log_syslog_name()
Return the syslog name.
void bg_log_translate(const char *translation_domain, bg_log_level_t level, const char *domain, const char *format,...) __attribute__((format(printf
Translate a message and send it to the logger.
void bg_log_syslog_init(const char *name)
Initialize syslog logging.
char * bg_log_last_error()
Get last error message.
void bg_log_set_verbose(int mask)
Set verbosity mask.
const char * bg_log_level_to_string(bg_log_level_t level)
Convert a log level to a human readable string.
void bg_log_set_dest(bg_msg_queue_t *q)
Set the log destination.
void bg_log_set_verbose_level(int level)
Set verbosity level.
bg_log_level_t
Log levels.
Definition log.h:52
void void bg_logs_notranslate(bg_log_level_t level, const char *domain, const char *str)
Send a message (as complete string) to the logger without translating it.
@ BG_LOG_WARNING
Something went wrong, but is not fatal.
Definition log.h:54
@ BG_LOG_ERROR
Something went wrong, cannot continue.
Definition log.h:55
@ BG_LOG_INFO
Something interesting the user might want to know.
Definition log.h:56
@ BG_LOG_DEBUG
Only for programmers, useless for users.
Definition log.h:53
struct bg_msg_queue_s bg_msg_queue_t
Opaque message queue type. You don't want to know what's inside.
Definition msgqueue.h:446