2017-06-20 09:51:42 +00:00
|
|
|
/*
|
2017-06-10 12:35:39 +00:00
|
|
|
* Copyright (c) 2017, Inria.
|
2017-06-20 09:51:42 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. Neither the name of the Institute nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* This file is part of the Contiki operating system.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file
|
|
|
|
* Default log levels for a number of modules
|
|
|
|
* \author
|
2017-06-10 12:35:39 +00:00
|
|
|
* Simon Duquennoy <simon.duquennoy@inria.fr>
|
2017-06-20 09:51:42 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/** \addtogroup sys
|
|
|
|
* @{ */
|
|
|
|
|
|
|
|
/** \addtogroup log
|
|
|
|
* @{ */
|
|
|
|
|
|
|
|
#ifndef __LOG_CONF_H__
|
|
|
|
#define __LOG_CONF_H__
|
|
|
|
|
2018-05-26 12:04:03 +00:00
|
|
|
/* Log only the last 16 bytes of link-layer and IPv6 addresses (or, if)
|
|
|
|
* the deployment module is enabled, the node IDs */
|
2017-06-26 12:24:47 +00:00
|
|
|
#ifdef LOG_CONF_WITH_COMPACT_ADDR
|
|
|
|
#define LOG_WITH_COMPACT_ADDR LOG_CONF_WITH_COMPACT_ADDR
|
|
|
|
#else /* LOG_CONF_WITH_COMPACT_ADDR */
|
|
|
|
#define LOG_WITH_COMPACT_ADDR 0
|
|
|
|
#endif /* LOG_CONF_WITH_COMPACT_ADDR */
|
|
|
|
|
|
|
|
/* Prefix all logs with file name and line-of-code */
|
|
|
|
#ifdef LOG_CONF_WITH_LOC
|
|
|
|
#define LOG_WITH_LOC LOG_CONF_WITH_LOC
|
|
|
|
#else /* LOG_CONF_WITH_LOC */
|
|
|
|
#define LOG_WITH_LOC 0
|
|
|
|
#endif /* LOG_CONF_WITH_LOC */
|
|
|
|
|
2017-10-18 00:08:47 +00:00
|
|
|
/* Prefix all logs with Module name and logging level */
|
|
|
|
#ifdef LOG_CONF_WITH_MODULE_PREFIX
|
|
|
|
#define LOG_WITH_MODULE_PREFIX LOG_CONF_WITH_MODULE_PREFIX
|
|
|
|
#else /* LOG_CONF_WITH_MODULE_PREFIX */
|
|
|
|
#define LOG_WITH_MODULE_PREFIX 1
|
|
|
|
#endif /* LOG_CONF_WITH_MODULE_PREFIX */
|
|
|
|
|
2017-06-26 12:24:47 +00:00
|
|
|
/* Cooja annotations */
|
|
|
|
#ifdef LOG_CONF_WITH_ANNOTATE
|
|
|
|
#define LOG_WITH_ANNOTATE LOG_CONF_WITH_ANNOTATE
|
|
|
|
#else /* LOG_CONF_WITH_ANNOTATE */
|
|
|
|
#define LOG_WITH_ANNOTATE 0
|
|
|
|
#endif /* LOG_CONF_WITH_ANNOTATE */
|
|
|
|
|
|
|
|
/* Custom output function -- default is printf */
|
|
|
|
#ifdef LOG_CONF_OUTPUT
|
|
|
|
#define LOG_OUTPUT(...) LOG_CONF_OUTPUT(__VA_ARGS__)
|
|
|
|
#else /* LOG_CONF_OUTPUT */
|
|
|
|
#define LOG_OUTPUT(...) printf(__VA_ARGS__)
|
|
|
|
#endif /* LOG_CONF_OUTPUT */
|
|
|
|
|
2017-11-30 21:40:07 +00:00
|
|
|
/*
|
|
|
|
* Custom output function to prefix logs with level and module.
|
|
|
|
*
|
|
|
|
* This will only be called when LOG_CONF_WITH_MODULE_PREFIX is enabled and
|
|
|
|
* all implementations should be based on LOG_OUTPUT.
|
|
|
|
*
|
|
|
|
* \param level The log level
|
|
|
|
* \param levelstr The log level as string
|
|
|
|
* \param module The module string descriptor
|
|
|
|
*/
|
2017-11-30 14:20:52 +00:00
|
|
|
#ifdef LOG_CONF_OUTPUT_PREFIX
|
|
|
|
#define LOG_OUTPUT_PREFIX(level, levelstr, module) LOG_CONF_OUTPUT_PREFIX(level, levelstr, module)
|
|
|
|
#else /* LOG_CONF_OUTPUT_PREFIX */
|
|
|
|
#define LOG_OUTPUT_PREFIX(level, levelstr, module) LOG_OUTPUT("[%-4s: %-10s] ", levelstr, module)
|
|
|
|
#endif /* LOG_CONF_OUTPUT_PREFIX */
|
|
|
|
|
2017-06-26 12:24:47 +00:00
|
|
|
/******************************************************************************/
|
|
|
|
/********************* A list of currently supported modules ******************/
|
|
|
|
/******************************************************************************/
|
2017-06-20 09:51:42 +00:00
|
|
|
|
2017-07-15 13:19:09 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_RPL
|
|
|
|
#define LOG_CONF_LEVEL_RPL LOG_LEVEL_NONE /* Only for rpl-lite */
|
|
|
|
#endif /* LOG_CONF_LEVEL_RPL */
|
2017-06-22 08:19:36 +00:00
|
|
|
|
2017-07-15 13:19:09 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_TCPIP
|
|
|
|
#define LOG_CONF_LEVEL_TCPIP LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_TCPIP */
|
2017-06-22 08:19:36 +00:00
|
|
|
|
2017-07-15 13:19:09 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_IPV6
|
|
|
|
#define LOG_CONF_LEVEL_IPV6 LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_IPV6 */
|
2017-06-20 16:06:30 +00:00
|
|
|
|
2017-07-15 13:19:09 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_6LOWPAN
|
|
|
|
#define LOG_CONF_LEVEL_6LOWPAN LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_6LOWPAN */
|
2017-06-20 09:51:42 +00:00
|
|
|
|
2017-09-15 15:31:45 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_NULLNET
|
2017-10-11 15:25:07 +00:00
|
|
|
#define LOG_CONF_LEVEL_NULLNET LOG_LEVEL_NONE
|
2017-09-15 15:31:45 +00:00
|
|
|
#endif /* LOG_CONF_LEVEL_NULLNET */
|
|
|
|
|
2017-07-15 13:19:09 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_MAC
|
|
|
|
#define LOG_CONF_LEVEL_MAC LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_MAC */
|
2017-06-20 09:51:42 +00:00
|
|
|
|
2017-07-15 13:19:09 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_FRAMER
|
|
|
|
#define LOG_CONF_LEVEL_FRAMER LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_FRAMER */
|
2017-06-20 16:26:31 +00:00
|
|
|
|
2017-07-11 15:26:40 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_6TOP
|
|
|
|
#define LOG_CONF_LEVEL_6TOP LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_6TOP */
|
|
|
|
|
2017-11-30 17:52:03 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_COAP
|
|
|
|
#define LOG_CONF_LEVEL_COAP LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_COAP */
|
|
|
|
|
2017-12-01 01:36:17 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_LWM2M
|
|
|
|
#define LOG_CONF_LEVEL_LWM2M LOG_LEVEL_NONE
|
|
|
|
#endif /* LOG_CONF_LEVEL_LWM2M */
|
|
|
|
|
2017-10-17 23:16:11 +00:00
|
|
|
#ifndef LOG_CONF_LEVEL_MAIN
|
|
|
|
#define LOG_CONF_LEVEL_MAIN LOG_LEVEL_INFO
|
|
|
|
#endif /* LOG_CONF_LEVEL_MAIN */
|
|
|
|
|
2017-06-20 09:51:42 +00:00
|
|
|
#endif /* __LOG_CONF_H__ */
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
/** @} */
|