/*
 * Copyright 2011 Free Software Foundation, Inc.
 *
 * This file was generated by gr_modtool, a tool from the GNU Radio framework
 * This file is a part of gr-leo
 *
 * GNU Radio is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * GNU Radio is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GNU Radio; see the file COPYING.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street,
 * Boston, MA 02110-1301, USA.
 */

#ifndef INCLUDE_LEO_LOG_H_
#define INCLUDE_LEO_LOG_H_


#include <stdio.h>
#include <errno.h>
#include <string.h>

#define LEO_MESSAGES 0
#define LEO_DEBUG_MESSAGES 0

#if LEO_MESSAGES
#define LEO_LOG_CLASS_INFO(CLASS_DEBUG_ENABLE, M, ...)                               \
        do {                                                                            \
                if(CLASS_DEBUG_ENABLE) {                                                \
                                fprintf(stderr, "[INFO]: " M " \n", ##__VA_ARGS__);     \
                }                                                                       \
        } while(0)

#else
#define LEO_LOG_CLASS_INFO(CLASS, M, ...)
#endif

#if LEO_MESSAGES
#define LEO_LOG_INFO(M, ...)                                                         \
                fprintf(stderr, "[INFO]: " M " \n", ##__VA_ARGS__)

#else
#define LEO_LOG_INFO(M, ...)
#endif

#define LEO_ERROR(M, ...)                                                    \
        fprintf(stderr, "[ERROR] %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)

#define LEO_WARN(M, ...)                                                             \
        fprintf(stderr, "[WARNING] %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)

#if LEO_DEBUG_MESSAGES
#define LEO_DEBUG(M, ...)                                                    \
        fprintf(stderr, "[DEBUG]: " M "\n", ##__VA_ARGS__)
#else
#define LEO_DEBUG(M, ...)
#endif



#endif /* INCLUDE_LEO_LOG_H_ */

