elog_cfg.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * This file is part of the EasyLogger Library.
  3. *
  4. * Copyright (c) 2015, 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. /* enable log output. default open this macro */
  31. #define ELOG_OUTPUT_ENABLE
  32. /* enable terminal output. default open this macro */
  33. #define ELOG_TERMINAL_ENABLE
  34. /* enable log write file. default open this macro */
  35. #define ELOG_FILE_ENABLE
  36. /* enable flush file cache. default open this macro */
  37. #define ELOG_FILE_FLUSH_CACHE_ENABLE
  38. /* setting static output log level */
  39. #define ELOG_OUTPUT_LVL ELOG_LVL_VERBOSE
  40. /* enable assert check */
  41. #define ELOG_ASSERT_ENABLE
  42. /* buffer size for every line's log */
  43. #define ELOG_LINE_BUF_SIZE 512
  44. /* output line number max length */
  45. #define ELOG_LINE_NUM_MAX_LEN 5
  46. /* output filter's tag max length */
  47. #define ELOG_FILTER_TAG_MAX_LEN 8
  48. /* output filter's keyword max length */
  49. #define ELOG_FILTER_KW_MAX_LEN 16
  50. /* output filter's tag level max num */
  51. #define ELOG_FILTER_TAG_LVL_MAX_NUM 5
  52. /* output newline sign */
  53. #define ELOG_NEWLINE_SIGN "\n"
  54. /* enable log color */
  55. #define ELOG_COLOR_ENABLE
  56. /* enable asynchronous output mode */
  57. #define ELOG_ASYNC_OUTPUT_ENABLE
  58. /* the highest output level for async mode, other level will sync output */
  59. #define ELOG_ASYNC_OUTPUT_LVL ELOG_LVL_DEBUG
  60. /* buffer size for asynchronous output mode */
  61. #define ELOG_ASYNC_OUTPUT_BUF_SIZE (ELOG_LINE_BUF_SIZE * 50)
  62. /* each asynchronous output's log which must end with newline sign */
  63. //#define ELOG_ASYNC_LINE_OUTPUT
  64. /* asynchronous output mode using POSIX pthread implementation */
  65. #define ELOG_ASYNC_OUTPUT_USING_PTHREAD
  66. #endif /* _ELOG_CFG_H_ */