elog_cfg.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * This file is part of the EasyLogger Library.
  3. *
  4. * Copyright (c) 2015-2016, Armink, <armink.ztl@gmail.com>
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining
  7. * a copy of this software and associated documentation files (the
  8. * 'Software'), to deal in the Software without restriction, including
  9. * without limitation the rights to use, copy, modify, merge, publish,
  10. * distribute, sublicense, and/or sell copies of the Software, and to
  11. * permit persons to whom the Software is furnished to do so, subject to
  12. * the following conditions:
  13. *
  14. * The above copyright notice and this permission notice shall be
  15. * included in all copies or substantial portions of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
  18. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  20. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  21. * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  22. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  23. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. *
  25. * Function: It is the configure head file for this library.
  26. * Created on: 2015-07-30
  27. */
  28. #ifndef _ELOG_CFG_H_
  29. #define _ELOG_CFG_H_
  30. /*---------------------------------------------------------------------------*/
  31. /* enable log output. */
  32. #define ELOG_OUTPUT_ENABLE
  33. /* setting static output log level. range: from ELOG_LVL_ASSERT to ELOG_LVL_VERBOSE */
  34. #define ELOG_OUTPUT_LVL ELOG_LVL_VERBOSE
  35. /* enable assert check */
  36. #define ELOG_ASSERT_ENABLE
  37. /* buffer size for every line's log */
  38. #define ELOG_LINE_BUF_SIZE 1024
  39. /* output line number max length */
  40. #define ELOG_LINE_NUM_MAX_LEN 5
  41. /* output filter's tag max length */
  42. #define ELOG_FILTER_TAG_MAX_LEN 30
  43. /* output filter's keyword max length */
  44. #define ELOG_FILTER_KW_MAX_LEN 16
  45. /* output filter's tag level max num */
  46. #define ELOG_FILTER_TAG_LVL_MAX_NUM 5
  47. /* output newline sign */
  48. #define ELOG_NEWLINE_SIGN "\n"
  49. /*---------------------------------------------------------------------------*/
  50. /* enable log color */
  51. #define ELOG_COLOR_ENABLE
  52. /* change the some level logs to not default color if you want */
  53. #define ELOG_COLOR_ASSERT (F_MAGENTA B_NULL S_NORMAL)
  54. #define ELOG_COLOR_ERROR (F_RED B_NULL S_NORMAL)
  55. #define ELOG_COLOR_WARN (F_YELLOW B_NULL S_NORMAL)
  56. #define ELOG_COLOR_INFO (F_CYAN B_NULL S_NORMAL)
  57. #define ELOG_COLOR_DEBUG (F_GREEN B_NULL S_NORMAL)
  58. #define ELOG_COLOR_VERBOSE (F_BLUE B_NULL S_NORMAL)
  59. /*---------------------------------------------------------------------------*/
  60. /* enable asynchronous output mode */
  61. #define ELOG_ASYNC_OUTPUT_ENABLE
  62. /* the highest output level for async mode, other level will sync output */
  63. #define ELOG_ASYNC_OUTPUT_LVL ELOG_LVL_ASSERT
  64. /* buffer size for asynchronous output mode */
  65. #define ELOG_ASYNC_OUTPUT_BUF_SIZE (ELOG_LINE_BUF_SIZE * 10)
  66. /* each asynchronous output's log which must end with newline sign */
  67. #define ELOG_ASYNC_LINE_OUTPUT
  68. /* asynchronous output mode using POSIX pthread implementation */
  69. #define ELOG_ASYNC_OUTPUT_USING_PTHREAD
  70. /*---------------------------------------------------------------------------*/
  71. /* enable buffered output mode */
  72. #define ELOG_BUF_OUTPUT_ENABLE
  73. /* buffer size for buffered output mode */
  74. #define ELOG_BUF_OUTPUT_BUF_SIZE (ELOG_LINE_BUF_SIZE * 10)
  75. #endif /* _ELOG_CFG_H_ */