logging_macros.hpp
Go to the documentation of this file.
00001 /*******************************************************************************
00002 * DO NOT MODIFY - AUTO-GENERATED
00003 *
00004 *
00005 * DISCLAMER:
00006 *
00007 * This project was created within an academic research setting, and thus should
00008 * be considered as EXPERIMENTAL code. There may be bugs and deficiencies in the
00009 * code, so please adjust expectations accordingly. With that said, we are
00010 * intrinsically motivated to ensure its correctness (and often its performance).
00011 * Please use the corresponding web repository tool (e.g. github/bitbucket/etc.)
00012 * to file bugs, suggestions, pull requests; we will do our best to address them
00013 * in a timely manner.
00014 *
00015 *
00016 * SOFTWARE LICENSE AGREEMENT (BSD LICENSE):
00017 *
00018 * Copyright (c) 2013, Anqi Xu
00019 * All rights reserved.
00020 *
00021 * Redistribution and use in source and binary forms, with or without
00022 * modification, are permitted provided that the following conditions
00023 * are met:
00024 *
00025 *  * Redistributions of source code must retain the above copyright
00026 *    notice, this list of conditions and the following disclaimer.
00027 *  * Redistributions in binary form must reproduce the above
00028 *    copyright notice, this list of conditions and the following
00029 *    disclaimer in the documentation and/or other materials provided
00030 *    with the distribution.
00031 *  * Neither the name of the School of Computer Science, McGill University,
00032 *    nor the names of its contributors may be used to endorse or promote
00033 *    products derived from this software without specific prior written
00034 *    permission.
00035 *
00036 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00037 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00038 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00039 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
00040 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00041 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00042 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00043 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00045 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00046 *******************************************************************************/
00047 
00048 #ifndef LOGGING_MACROS_HPP_
00049 #define LOGGING_MACROS_HPP_
00050 
00056 #define STD_LOGGING_MACROS 0
00057 #define ROS_LOGGING_MACROS 1
00058 #define NODELET_LOGGING_MACROS 2
00059 #define LOGGING_MACROS_TYPE NODELET_LOGGING_MACROS
00060 
00061 
00062 #if LOGGING_MACROS_TYPE == ROS_LOGGING_MACROS
00063 
00064   #include <ros/console.h>
00065 
00066   #define DEBUG(...) ROS_DEBUG(__VA_ARGS__)
00067   #define INFO(...) ROS_INFO(__VA_ARGS__)
00068   #define WARN(...) ROS_WARN(__VA_ARGS__)
00069   #define ERROR(...) ROS_ERROR(__VA_ARGS__)
00070   #define FATAL(...) ROS_FATAL(__VA_ARGS__)
00071   #define DEBUG_STREAM(...) ROS_DEBUG_STREAM(__VA_ARGS__)
00072   #define INFO_STREAM(...) ROS_INFO_STREAM(__VA_ARGS__)
00073   #define WARN_STREAM(...) ROS_WARN_STREAM(__VA_ARGS__)
00074   #define ERROR_STREAM(...) ROS_ERROR_STREAM(__VA_ARGS__)
00075   #define FATAL_STREAM(...) ROS_FATAL_STREAM(__VA_ARGS__)
00076 
00077 #elif LOGGING_MACROS_TYPE == NODELET_LOGGING_MACROS
00078 
00079   #include <ros/ros.h>
00080   #include <nodelet/nodelet.h>
00081 
00082   using namespace ros::this_node;
00083 
00084   #define DEBUG(...) NODELET_DEBUG(__VA_ARGS__)
00085   #define INFO(...) NODELET_INFO(__VA_ARGS__)
00086   #define WARN(...) NODELET_WARN(__VA_ARGS__)
00087   #define ERROR(...) NODELET_ERROR(__VA_ARGS__)
00088   #define FATAL(...) NODELET_FATAL(__VA_ARGS__)
00089   #define DEBUG_STREAM(...) NODELET_DEBUG_STREAM(__VA_ARGS__)
00090   #define INFO_STREAM(...) NODELET_INFO_STREAM(__VA_ARGS__)
00091   #define WARN_STREAM(...) NODELET_WARN_STREAM(__VA_ARGS__)
00092   #define ERROR_STREAM(...) NODELET_ERROR_STREAM(__VA_ARGS__)
00093   #define FATAL_STREAM(...) NODELET_FATAL_STREAM(__VA_ARGS__)
00094 
00095 #else
00096   #include <cstdio>
00097   #include <iostream>
00098 
00099   #define DEBUG(...) fprintf(stdout, "DEBUG> "); fprintf(stdout, __VA_ARGS__); fprintf(stdout, "\n")
00100   #define INFO(...) fprintf(stdout, "INFO > "); fprintf(stdout, __VA_ARGS__); fprintf(stdout, "\n")
00101   #define WARN(...) fprintf(stderr, "WARN > "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n")
00102   #define ERROR(...) fprintf(stderr, "ERROR> "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n")
00103   #define FATAL(...) fprintf(stderr, "FATAL> "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, "\n")
00104   #define DEBUG_STREAM(...) std::cout << "DEBUG> " << __VA_ARGS__ << std::endl
00105   #define INFO_STREAM(...) std::cout << "INFO > " << __VA_ARGS__ << std::endl
00106   #define WARN_STREAM(...) std::cerr << "WARN > " << __VA_ARGS__ << std::endl
00107   #define ERROR_STREAM(...) std::cerr << "ERROR> " << __VA_ARGS__ << std::endl
00108   #define FATAL_STREAM(...) std::cerr << "FATAL> " << __VA_ARGS__ << std::endl
00109 
00110 #endif
00111 
00112 #endif /* LOGGING_MACROS_HPP_ */


ueye_cam
Author(s): Anqi Xu
autogenerated on Mon Oct 6 2014 08:20:41