Blame tools/log.h

Packit Service 68b988
/*
Packit Service 68b988
 * kmod - log infrastructure
Packit Service 68b988
 *
Packit Service 68b988
 * Copyright (C) 2012-2013  ProFUSION embedded systems
Packit Service 68b988
 *
Packit Service 68b988
 * This program is free software: you can redistribute it and/or modify
Packit Service 68b988
 * it under the terms of the GNU General Public License as published by
Packit Service 68b988
 * the Free Software Foundation, either version 2 of the License, or
Packit Service 68b988
 * (at your option) any later version.
Packit Service 68b988
 *
Packit Service 68b988
 * This program is distributed in the hope that it will be useful,
Packit Service 68b988
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 68b988
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 68b988
 * GNU General Public License for more details.
Packit Service 68b988
 *
Packit Service 68b988
 * You should have received a copy of the GNU General Public License
Packit Service 68b988
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service 68b988
 */
Packit Service 68b988
Packit Service 68b988
#include <stdarg.h>
Packit Service 68b988
#include <stdbool.h>
Packit Service 68b988
#include <stdio.h>
Packit Service 68b988
#include <syslog.h>
Packit Service 68b988
Packit Service 68b988
#include "kmod.h"
Packit Service 68b988
Packit Service 68b988
void log_open(bool use_syslog);
Packit Service 68b988
void log_close(void);
Packit Service 68b988
void log_printf(int prio, const char *fmt, ...) _printf_format_(2, 3);
Packit Service 68b988
#define CRIT(...) log_printf(LOG_CRIT, __VA_ARGS__)
Packit Service 68b988
#define ERR(...) log_printf(LOG_ERR, __VA_ARGS__)
Packit Service 68b988
#define WRN(...) log_printf(LOG_WARNING, __VA_ARGS__)
Packit Service 68b988
#define INF(...) log_printf(LOG_INFO, __VA_ARGS__)
Packit Service 68b988
#define DBG(...) log_printf(LOG_DEBUG, __VA_ARGS__)
Packit Service 68b988
Packit Service 68b988
struct kmod_ctx;
Packit Service 68b988
void log_setup_kmod_log(struct kmod_ctx *ctx, int priority);