patch-docs_man3_qblog_h_3 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649
  1. --- libqb-0.16.0.orig/docs/man3/qblog.h.3 2013-07-25 20:16:18.000000000 +0200
  2. +++ libqb-0.16.0/docs/man3/qblog.h.3 2013-09-09 05:26:31.703807649 +0200
  3. @@ -1,4 +1,4 @@
  4. -.TH "qblog.h" 3 "Thu Jul 25 2013" "Version 0.16.0" "libqb" \" -*- nroff -*-
  5. +.TH "qblog.h" 3 "Mon Sep 9 2013" "Version 0.16.0" "libqb" \" -*- nroff -*-
  6. .ad l
  7. .nh
  8. .SH NAME
  9. @@ -36,7 +36,7 @@ The logging API provides four main parts
  10. .br
  11. .RI "\fIAn instance of this structure is created in a special ELF section at every dynamic debug callsite\&. \fP"
  12. .in -1c
  13. -.SS "Macros"
  14. +.SS "Defines"
  15. .in +1c
  16. .ti -1c
  17. @@ -117,7 +117,7 @@ The logging API provides four main parts
  18. .in +1c
  19. .ti -1c
  20. -.RI "enum \fBqb_log_target_state\fP { \fBQB_LOG_STATE_UNUSED\fP = 1, \fBQB_LOG_STATE_DISABLED\fP = 2, \fBQB_LOG_STATE_ENABLED\fP = 3 }"
  21. +.RI "enum \fBqb_log_target_state\fP { \fBQB_LOG_STATE_UNUSED\fP = 1, \fBQB_LOG_STATE_DISABLED\fP = 2, \fBQB_LOG_STATE_ENABLED\fP = 3 }"
  22. .br
  23. .ti -1c
  24. .RI "enum \fBqb_log_conf\fP { \fBQB_LOG_CONF_ENABLED\fP, \fBQB_LOG_CONF_FACILITY\fP, \fBQB_LOG_CONF_DEBUG\fP, \fBQB_LOG_CONF_SIZE\fP, \fBQB_LOG_CONF_THREADED\fP, \fBQB_LOG_CONF_PRIORITY_BUMP\fP, \fBQB_LOG_CONF_STATE_GET\fP, \fBQB_LOG_CONF_FILE_SYNC\fP }"
  25. @@ -294,13 +294,13 @@ Call \fBqb_log()\fP to generate a log me
  26. Simplist possible use:
  27. .PP
  28. .nf
  29. -main() {
  30. - qb_log_init('simple-log', LOG_DAEMON, LOG_INFO);
  31. + main() {
  32. + qb_log_init('simple-log', LOG_DAEMON, LOG_INFO);
  33. // \&.\&.\&.
  34. - qb_log(LOG_WARNING, 'watch out');
  35. + qb_log(LOG_WARNING, 'watch out');
  36. // \&.\&.\&.
  37. - qb_log_fini();
  38. -}
  39. + qb_log_fini();
  40. + }
  41. .fi
  42. .PP
  43. @@ -313,7 +313,7 @@ A log target can by syslog, stderr, the
  44. To enable a target do the following
  45. .PP
  46. .nf
  47. -qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_TRUE);
  48. + qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_TRUE);
  49. .fi
  50. .PP
  51. @@ -321,8 +321,8 @@ qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_
  52. syslog, stderr and the blackbox are static (they don't need to be created, just enabled or disabled\&. However you can open multiple logfiles (32 - QB_LOG_BLACKBOX)\&. To do this use the following code\&.
  53. .PP
  54. .nf
  55. -mytarget = qb_log_file_open('/var/log/mylogfile');
  56. -qb_log_ctl(mytarget, QB_LOG_CONF_ENABLED, QB_TRUE);
  57. + mytarget = qb_log_file_open('/var/log/mylogfile');
  58. + qb_log_ctl(mytarget, QB_LOG_CONF_ENABLED, QB_TRUE);
  59. .fi
  60. .PP
  61. @@ -330,7 +330,7 @@ qb_log_ctl(mytarget, QB_LOG_CONF_ENABLED
  62. Once your targets are enabled/opened you can configure them as follows: Configure the size of blackbox
  63. .PP
  64. .nf
  65. -qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_SIZE, 1024*10);
  66. + qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_SIZE, 1024*10);
  67. .fi
  68. .PP
  69. @@ -338,7 +338,7 @@ qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_
  70. Make logging to file threaded:
  71. .PP
  72. .nf
  73. -qb_log_ctl(mytarget, QB_LOG_CONF_THREADED, QB_TRUE);
  74. + qb_log_ctl(mytarget, QB_LOG_CONF_THREADED, QB_TRUE);
  75. .fi
  76. .PP
  77. @@ -346,8 +346,8 @@ qb_log_ctl(mytarget, QB_LOG_CONF_THREADE
  78. To workaround your syslog daemon filtering all messages > LOG_INFO
  79. .PP
  80. .nf
  81. -qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PRIORITY_BUMP,
  82. - LOG_INFO - LOG_DEBUG);
  83. + qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PRIORITY_BUMP,
  84. + LOG_INFO - LOG_DEBUG);
  85. .fi
  86. .PP
  87. @@ -355,7 +355,7 @@ qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_PR
  88. To ensure all logs to file targets are fsync'ed (default QB_FALSE)
  89. .PP
  90. .nf
  91. -qb_log_ctl(mytarget, QB_LOG_CONF_FILE_SYNC, QB_TRUE);
  92. + qb_log_ctl(mytarget, QB_LOG_CONF_FILE_SYNC, QB_TRUE);
  93. .fi
  94. .PP
  95. @@ -375,8 +375,8 @@ format string + priority
  96. So to make all logs from evil_fnunction() go to stderr do the following:
  97. .PP
  98. .nf
  99. -qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
  100. - QB_LOG_FILTER_FUNCTION, 'evil_fnunction', LOG_TRACE);
  101. + qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
  102. + QB_LOG_FILTER_FUNCTION, 'evil_fnunction', LOG_TRACE);
  103. .fi
  104. .PP
  105. @@ -384,8 +384,8 @@ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_
  106. So to make all logs from totem* (with a priority <= LOG_INFO) go to stderr do the following:
  107. .PP
  108. .nf
  109. -qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
  110. - QB_LOG_FILTER_FILE, 'totem', LOG_INFO);
  111. + qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
  112. + QB_LOG_FILTER_FILE, 'totem', LOG_INFO);
  113. .fi
  114. .PP
  115. @@ -393,8 +393,8 @@ qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_
  116. So to make all logs with the substring 'ringbuffer' go to stderr do the following:
  117. .PP
  118. .nf
  119. -qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
  120. - QB_LOG_FILTER_FORMAT, 'ringbuffer', LOG_TRACE);
  121. + qb_log_filter_ctl(QB_LOG_STDERR, QB_LOG_FILTER_ADD,
  122. + QB_LOG_FILTER_FORMAT, 'ringbuffer', LOG_TRACE);
  123. .fi
  124. .PP
  125. @@ -407,18 +407,18 @@ To achieve non-blocking logging you can
  126. Threaded logging use:
  127. .PP
  128. .nf
  129. -main() {
  130. - qb_log_init('simple-log', LOG_DAEMON, LOG_INFO);
  131. - qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_THREADED, QB_TRUE);
  132. + main() {
  133. + qb_log_init('simple-log', LOG_DAEMON, LOG_INFO);
  134. + qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_THREADED, QB_TRUE);
  135. // \&.\&.\&.
  136. daemonize();
  137. // call this after you fork()
  138. qb_log_thread_start();
  139. // \&.\&.\&.
  140. - qb_log(LOG_WARNING, 'watch out');
  141. + qb_log(LOG_WARNING, 'watch out');
  142. // \&.\&.\&.
  143. - qb_log_fini();
  144. -}
  145. + qb_log_fini();
  146. + }
  147. .fi
  148. .PP
  149. @@ -436,28 +436,28 @@ the blackbox is not enabled by default\&
  150. Blackbox usage:
  151. .PP
  152. .nf
  153. -static void sigsegv_handler(int sig)
  154. -{
  155. + static void sigsegv_handler(int sig)
  156. + {
  157. (void)signal (SIGSEGV, SIG_DFL);
  158. qb_log_blackbox_write_to_file('simple-log\&.fdata');
  159. qb_log_fini();
  160. raise(SIGSEGV);
  161. -}
  162. + }
  163. -main() {
  164. + main() {
  165. - signal(SIGSEGV, sigsegv_handler);
  166. + signal(SIGSEGV, sigsegv_handler);
  167. - qb_log_init('simple-log', LOG_DAEMON, LOG_INFO);
  168. - qb_log_filter_ctl(QB_LOG_BLACKBOX, QB_LOG_FILTER_ADD,
  169. - QB_LOG_FILTER_FILE, '*', LOG_DEBUG);
  170. - qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_SIZE, 1024*10);
  171. - qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_TRUE);
  172. + qb_log_init('simple-log', LOG_DAEMON, LOG_INFO);
  173. + qb_log_filter_ctl(QB_LOG_BLACKBOX, QB_LOG_FILTER_ADD,
  174. + QB_LOG_FILTER_FILE, '*', LOG_DEBUG);
  175. + qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_SIZE, 1024*10);
  176. + qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_ENABLED, QB_TRUE);
  177. // \&.\&.\&.
  178. - qb_log(LOG_WARNING, 'watch out');
  179. + qb_log(LOG_WARNING, 'watch out');
  180. // \&.\&.\&.
  181. - qb_log_fini();
  182. -}
  183. + qb_log_fini();
  184. + }
  185. .fi
  186. .PP
  187. @@ -469,7 +469,7 @@ You can tag messages using the second ar
  188. .PP
  189. .PP
  190. .nf
  191. -const char* my_tags_stringify(uint32_t tags) {
  192. + const char* my_tags_stringify(uint32_t tags) {
  193. if (qb_bit_is_set(tags, QB_LOG_TAG_LIBQB_MSG_BIT) {
  194. return 'libqb';
  195. } else if (tags == 3) {
  196. @@ -477,37 +477,33 @@ const char* my_tags_stringify(uint32_t t
  197. } else {
  198. return 'MAIN';
  199. }
  200. -}
  201. -main() {
  202. + }
  203. + main() {
  204. // \&.\&.\&.
  205. qb_log_tags_stringify_fn_set(my_tags_stringify);
  206. qb_log_format_set(QB_LOG_STDERR, '[%5g] %p %b');
  207. // \&.\&.\&.
  208. qb_logt(LOG_INFO, 3, 'hello');
  209. qb_logt(LOG_INFO, 0, 'hello');
  210. -}
  211. + }
  212. .fi
  213. .PP
  214. The code above will produce:
  215. .PP
  216. .nf
  217. -[libqb] some message
  218. -[three] info hello
  219. -[MAIN ] info hello
  220. + [libqb] some message
  221. + [three] info hello
  222. + [MAIN ] info hello
  223. .fi
  224. .PP
  225. -.SH "Macro Definition Documentation"
  226. +.SH "Define Documentation"
  227. .PP
  228. -.SS "#define LOG_TRACE (LOG_DEBUG + 1)"
  229. -
  230. -.SS "#define qb_enter() \fBqb_log\fP(\fBLOG_TRACE\fP, 'ENTERING %s()', __func__)"
  231. -
  232. -.SS "#define qb_leave() \fBqb_log\fP(\fBLOG_TRACE\fP, 'LEAVING %s()', __func__)"
  233. -
  234. -.SS "#define qb_log(\fBpriority\fP, fmt, args\&.\&.\&.) \fBqb_logt\fP(\fBpriority\fP, 0, fmt, ##args)"
  235. -
  236. +.SS "#define \fBLOG_TRACE\fP (LOG_DEBUG + 1)"
  237. +.SS "#define \fBqb_enter\fP() \fBqb_log\fP(\fBLOG_TRACE\fP, 'ENTERING %s()', __func__)"
  238. +.SS "#define \fBqb_leave\fP() \fBqb_log\fP(\fBLOG_TRACE\fP, 'LEAVING %s()', __func__)"
  239. +.SS "#define \fBqb_log\fP(\fBpriority\fP, fmt, args\&.\&.\&.) \fBqb_logt\fP(\fBpriority\fP, 0, fmt, ##args)"
  240. .PP
  241. This is the main function to generate a log message\&. \fBParameters:\fP
  242. .RS 4
  243. @@ -519,34 +515,23 @@ This is the main function to generate a
  244. .RE
  245. .PP
  246. -.SS "#define QB_LOG_BLACKBOX 2"
  247. -
  248. -.SS "#define QB_LOG_INIT_DATA(name)"
  249. -\fBValue:\fP
  250. +.SS "#define \fBQB_LOG_BLACKBOX\fP 2"
  251. +.SS "#define \fBQB_LOG_INIT_DATA\fP(name)"\fBValue:\fP
  252. .PP
  253. .nf
  254. void name(void); \
  255. void name(void) { if (__start___verbose != __stop___verbose) {assert(1);} } \
  256. void __attribute__ ((constructor)) name(void);
  257. .fi
  258. -.SS "#define QB_LOG_MAX_LEN 512"
  259. -
  260. -.SS "#define QB_LOG_STDERR 1"
  261. -
  262. -.SS "#define QB_LOG_STDOUT 3"
  263. -
  264. -.SS "#define QB_LOG_STRERROR_MAX_LEN 128"
  265. -
  266. -.SS "#define QB_LOG_SYSLOG 0"
  267. -
  268. -.SS "#define QB_LOG_TAG_LIBQB_MSG (1 << \fBQB_LOG_TAG_LIBQB_MSG_BIT\fP)"
  269. -
  270. -.SS "#define QB_LOG_TAG_LIBQB_MSG_BIT 31"
  271. -
  272. -.SS "#define QB_LOG_TARGET_MAX 32"
  273. -
  274. -.SS "#define qb_logt(\fBpriority\fP, \fBtags\fP, fmt, args\&.\&.\&.)"
  275. -\fBValue:\fP
  276. +.SS "#define \fBQB_LOG_MAX_LEN\fP 512"
  277. +.SS "#define \fBQB_LOG_STDERR\fP 1"
  278. +.SS "#define \fBQB_LOG_STDOUT\fP 3"
  279. +.SS "#define \fBQB_LOG_STRERROR_MAX_LEN\fP 128"
  280. +.SS "#define \fBQB_LOG_SYSLOG\fP 0"
  281. +.SS "#define \fBQB_LOG_TAG_LIBQB_MSG\fP (1 << \fBQB_LOG_TAG_LIBQB_MSG_BIT\fP)"
  282. +.SS "#define \fBQB_LOG_TAG_LIBQB_MSG_BIT\fP 31"
  283. +.SS "#define \fBQB_LOG_TARGET_MAX\fP 32"
  284. +.SS "#define \fBqb_logt\fP(\fBpriority\fP, \fBtags\fP, fmt, args\&.\&.\&.)"\fBValue:\fP
  285. .PP
  286. .nf
  287. do { \
  288. @@ -569,8 +554,7 @@ This is the function to generate a log m
  289. .RE
  290. .PP
  291. -.SS "#define qb_perror(\fBpriority\fP, fmt, args\&.\&.\&.)"
  292. -\fBValue:\fP
  293. +.SS "#define \fBqb_perror\fP(\fBpriority\fP, fmt, args\&.\&.\&.)"\fBValue:\fP
  294. .PP
  295. .nf
  296. do { \
  297. @@ -592,24 +576,17 @@ This is similar to perror except it goes
  298. .SH "Typedef Documentation"
  299. .PP
  300. -.SS "typedef void(* qb_log_close_fn)(int32_t t)"
  301. -
  302. -.SS "typedef void(* qb_log_filter_fn)(struct \fBqb_log_callsite\fP *cs)"
  303. -
  304. -.SS "typedef void(* qb_log_logger_fn)(int32_t t, struct \fBqb_log_callsite\fP *cs, time_t timestamp, const char *msg)"
  305. -
  306. -.SS "typedef void(* qb_log_reload_fn)(int32_t t)"
  307. -
  308. -.SS "typedef const char*(* qb_log_tags_stringify_fn)(uint32_t \fBtags\fP)"
  309. -
  310. -.SS "typedef void(* qb_log_vlogger_fn)(int32_t t, struct \fBqb_log_callsite\fP *cs, time_t timestamp, va_list ap)"
  311. -
  312. +.SS "typedef void(* \fBqb_log_close_fn\fP)(int32_t t)"
  313. +.SS "typedef void(* \fBqb_log_filter_fn\fP)(struct \fBqb_log_callsite\fP *cs)"
  314. +.SS "typedef void(* \fBqb_log_logger_fn\fP)(int32_t t, struct \fBqb_log_callsite\fP *cs, time_t timestamp, const char *msg)"
  315. +.SS "typedef void(* \fBqb_log_reload_fn\fP)(int32_t t)"
  316. +.SS "typedef const char*(* \fBqb_log_tags_stringify_fn\fP)(uint32_t \fBtags\fP)"
  317. +.SS "typedef void(* \fBqb_log_vlogger_fn\fP)(int32_t t, struct \fBqb_log_callsite\fP *cs, time_t timestamp, va_list ap)"
  318. .SH "Enumeration Type Documentation"
  319. .PP
  320. .SS "enum \fBqb_log_conf\fP"
  321. -
  322. .PP
  323. -\fBEnumerator\fP
  324. +\fBEnumerator: \fP
  325. .in +1c
  326. .TP
  327. \fB\fIQB_LOG_CONF_ENABLED \fP\fP
  328. @@ -627,10 +604,10 @@ This is similar to perror except it goes
  329. \fB\fIQB_LOG_CONF_STATE_GET \fP\fP
  330. .TP
  331. \fB\fIQB_LOG_CONF_FILE_SYNC \fP\fP
  332. -.SS "enum \fBqb_log_filter_conf\fP"
  333. +.SS "enum \fBqb_log_filter_conf\fP"
  334. .PP
  335. -\fBEnumerator\fP
  336. +\fBEnumerator: \fP
  337. .in +1c
  338. .TP
  339. \fB\fIQB_LOG_FILTER_ADD \fP\fP
  340. @@ -644,10 +621,10 @@ This is similar to perror except it goes
  341. \fB\fIQB_LOG_TAG_CLEAR \fP\fP
  342. .TP
  343. \fB\fIQB_LOG_TAG_CLEAR_ALL \fP\fP
  344. -.SS "enum \fBqb_log_filter_type\fP"
  345. +.SS "enum \fBqb_log_filter_type\fP"
  346. .PP
  347. -\fBEnumerator\fP
  348. +\fBEnumerator: \fP
  349. .in +1c
  350. .TP
  351. \fB\fIQB_LOG_FILTER_FILE \fP\fP
  352. @@ -655,10 +632,10 @@ This is similar to perror except it goes
  353. \fB\fIQB_LOG_FILTER_FUNCTION \fP\fP
  354. .TP
  355. \fB\fIQB_LOG_FILTER_FORMAT \fP\fP
  356. -.SS "enum \fBqb_log_target_state\fP"
  357. +.SS "enum \fBqb_log_target_state\fP"
  358. .PP
  359. -\fBEnumerator\fP
  360. +\fBEnumerator: \fP
  361. .in +1c
  362. .TP
  363. \fB\fIQB_LOG_STATE_UNUSED \fP\fP
  364. @@ -666,20 +643,17 @@ This is similar to perror except it goes
  365. \fB\fIQB_LOG_STATE_DISABLED \fP\fP
  366. .TP
  367. \fB\fIQB_LOG_STATE_ENABLED \fP\fP
  368. +
  369. .SH "Function Documentation"
  370. .PP
  371. -.SS "struct \fBqb_log_callsite\fP __attribute__ ((aligned(8)))"
  372. -
  373. -.SS "void qb_log_blackbox_print_from_file (const char *filename)"
  374. -
  375. +.SS "struct \fBqb_log_callsite\fP \fB__attribute__\fP ((aligned(8)))"
  376. +.SS "void \fBqb_log_blackbox_print_from_file\fP (const char *filename)"
  377. .PP
  378. Read the blackbox for file and print it out\&.
  379. -.SS "ssize_t qb_log_blackbox_write_to_file (const char *filename)"
  380. -
  381. +.SS "ssize_t \fBqb_log_blackbox_write_to_file\fP (const char *filename)"
  382. .PP
  383. Write the blackbox to file\&.
  384. -.SS "struct \fBqb_log_callsite\fP* qb_log_callsite_get (const char *function, const char *filename, const char *format, uint8_tpriority, uint32_tlineno, uint32_ttags)\fC [read]\fP"
  385. -
  386. +.SS "struct \fBqb_log_callsite\fP* \fBqb_log_callsite_get\fP (const char *function, const char *filename, const char *format, uint8_tpriority, uint32_tlineno, uint32_ttags)\fC [read]\fP"
  387. .PP
  388. Get or create a callsite at the give position\&. The result can then be passed into \fBqb_log_real_()\fP
  389. .PP
  390. @@ -699,23 +673,20 @@ Get or create a callsite at the give pos
  391. .RE
  392. .PP
  393. -.SS "void qb_log_callsites_dump (void)"
  394. -
  395. +.SS "void \fBqb_log_callsites_dump\fP (void)"
  396. .PP
  397. Dump the callsite info to stdout\&.
  398. -.SS "int32_t qb_log_callsites_register (struct \fBqb_log_callsite\fP *_start, struct \fBqb_log_callsite\fP *_stop)"
  399. -
  400. +.SS "int32_t \fBqb_log_callsites_register\fP (struct \fBqb_log_callsite\fP *_start, struct \fBqb_log_callsite\fP *_stop)"
  401. .PP
  402. If you are using dynamically loadable modules via dlopen() and you load them after \fBqb_log_init()\fP then after you load the module you will need to do the following to get the filters to work in that module\&. .PP
  403. .nf
  404. - _start = dlsym (dl_handle, '__start___verbose');
  405. -_stop = dlsym (dl_handle, '__stop___verbose');
  406. -qb_log_callsites_register(_start, _stop);
  407. + _start = dlsym (dl_handle, '__start___verbose');
  408. + _stop = dlsym (dl_handle, '__stop___verbose');
  409. + qb_log_callsites_register(_start, _stop);
  410. .fi
  411. .PP
  412. -.SS "int32_t qb_log_ctl (int32_ttarget, enum \fBqb_log_conf\fPconf_type, int32_targ)"
  413. -
  414. +.SS "int32_t \fBqb_log_ctl\fP (int32_ttarget, enum \fBqb_log_conf\fPconf_type, int32_targ)"
  415. .PP
  416. Main logging control function\&. \fBParameters:\fP
  417. .RS 4
  418. @@ -726,7 +697,7 @@ Main logging control function\&. \fBPara
  419. \fIarg\fP the new value
  420. .RE
  421. .PP
  422. -\fBSee Also:\fP
  423. +\fBSee also:\fP
  424. .RS 4
  425. \fBqb_log_conf\fP
  426. .RE
  427. @@ -741,12 +712,10 @@ Main logging control function\&. \fBPara
  428. .RE
  429. .PP
  430. -.SS "void qb_log_custom_close (int32_tt)"
  431. -
  432. +.SS "void \fBqb_log_custom_close\fP (int32_tt)"
  433. .PP
  434. Close a custom log target and release is resources\&.
  435. -.SS "int32_t qb_log_custom_open (\fBqb_log_logger_fn\fPlog_fn, \fBqb_log_close_fn\fPclose_fn, \fBqb_log_reload_fn\fPreload_fn, void *user_data)"
  436. -
  437. +.SS "int32_t \fBqb_log_custom_open\fP (\fBqb_log_logger_fn\fPlog_fn, \fBqb_log_close_fn\fPclose_fn, \fBqb_log_reload_fn\fPreload_fn, void *user_data)"
  438. .PP
  439. Open a custom log target\&. \fBReturn values:\fP
  440. .RS 4
  441. @@ -756,20 +725,16 @@ Open a custom log target\&. \fBReturn va
  442. .RE
  443. .PP
  444. -.SS "int32_t qb_log_facility2int (const char *fname)"
  445. -
  446. +.SS "int32_t \fBqb_log_facility2int\fP (const char *fname)"
  447. .PP
  448. Convert string 'auth' to equivalent number 'LOG_AUTH' etc\&.
  449. -.SS "const char* qb_log_facility2str (int32_tfnum)"
  450. -
  451. +.SS "const char* \fBqb_log_facility2str\fP (int32_tfnum)"
  452. .PP
  453. Convert number 'LOG_AUTH' to equivalent string 'auth' etc\&.
  454. -.SS "void qb_log_file_close (int32_tt)"
  455. -
  456. +.SS "void \fBqb_log_file_close\fP (int32_tt)"
  457. .PP
  458. Close a log file and release is resources\&.
  459. -.SS "int32_t qb_log_file_open (const char *filename)"
  460. -
  461. +.SS "int32_t \fBqb_log_file_open\fP (const char *filename)"
  462. .PP
  463. Open a log file\&. \fBReturn values:\fP
  464. .RS 4
  465. @@ -779,22 +744,19 @@ Open a log file\&. \fBReturn values:\fP
  466. .RE
  467. .PP
  468. -.SS "int32_t qb_log_filter_ctl (int32_tvalue, enum \fBqb_log_filter_conf\fPc, enum \fBqb_log_filter_type\fPtype, const char *text, uint8_tlow_priority)"
  469. -
  470. +.SS "int32_t \fBqb_log_filter_ctl\fP (int32_tvalue, enum \fBqb_log_filter_conf\fPc, enum \fBqb_log_filter_type\fPtype, const char *text, uint8_tlow_priority)"
  471. .PP
  472. This allows you modify the 'tags' and 'targets' callsite fields at runtime\&.
  473. -.SS "int32_t qb_log_filter_ctl2 (int32_tvalue, enum \fBqb_log_filter_conf\fPc, enum \fBqb_log_filter_type\fPtype, const char *text, uint8_thigh_priority, uint8_tlow_priority)"
  474. -
  475. +.SS "int32_t \fBqb_log_filter_ctl2\fP (int32_tvalue, enum \fBqb_log_filter_conf\fPc, enum \fBqb_log_filter_type\fPtype, const char *text, uint8_thigh_priority, uint8_tlow_priority)"
  476. .PP
  477. This extends \fBqb_log_filter_ctl()\fP by been able to provide a high_priority\&.
  478. -.SS "int32_t qb_log_filter_fn_set (\fBqb_log_filter_fn\fPfn)"
  479. -
  480. +.SS "int32_t \fBqb_log_filter_fn_set\fP (\fBqb_log_filter_fn\fPfn)"
  481. .PP
  482. Instead of using the \fBqb_log_filter_ctl()\fP functions you can apply the filters manually by defining a callback and setting the targets field using \fBqb_bit_set()\fP and \fBqb_bit_clear()\fP like the following below\&. .PP
  483. .nf
  484. -static void
  485. -m_filter(struct qb_log_callsite *cs)
  486. -{
  487. + static void
  488. + m_filter(struct qb_log_callsite *cs)
  489. + {
  490. if ((cs->priority >= LOG_ALERT &&
  491. cs->priority <= LOG_DEBUG) &&
  492. strcmp(cs->filename, 'my_c_file\&.c') == 0) {
  493. @@ -802,22 +764,19 @@ m_filter(struct qb_log_callsite *cs)
  494. } else {
  495. qb_bit_clear(cs->targets, QB_LOG_SYSLOG);
  496. }
  497. -}
  498. + }
  499. .fi
  500. .PP
  501. -.SS "void qb_log_fini (void)"
  502. -
  503. +.SS "void \fBqb_log_fini\fP (void)"
  504. .PP
  505. Logging system finalization function\&. It releases any shared memory\&. Stops the logging thread if running\&. Flushes the last message to their destinations\&.
  506. -.SS "void qb_log_format_set (int32_tt, const char *format)"
  507. -
  508. +.SS "void \fBqb_log_format_set\fP (int32_tt, const char *format)"
  509. .PP
  510. Set the format specifiers\&. n FUNCTION NAME f FILENAME l FILELINE p PRIORITY t TIMESTAMP b BUFFER g TAGS N name (passed into qb_log_init) P PID H hostname
  511. .PP
  512. any number between % and character specify field length to pad or chop
  513. -.SS "void qb_log_from_external_source (const char *function, const char *filename, const char *format, uint8_tpriority, uint32_tlineno, uint32_ttags, \&.\&.\&.)"
  514. -
  515. +.SS "void \fBqb_log_from_external_source\fP (const char *function, const char *filename, const char *format, uint8_tpriority, uint32_tlineno, uint32_ttags, \&.\&.\&.)"
  516. .PP
  517. This function is to import logs from other code (like libraries) that provide a callback with their logs\&. \fBNote:\fP
  518. .RS 4
  519. @@ -840,10 +799,8 @@ the performance of this will not impress
  520. .RE
  521. .PP
  522. -.SS "void qb_log_from_external_source_va (const char *function, const char *filename, const char *format, uint8_tpriority, uint32_tlineno, uint32_ttags, va_listap)"
  523. -
  524. -.SS "void qb_log_init (const char *name, int32_tfacility, uint8_tpriority)"
  525. -
  526. +.SS "void \fBqb_log_from_external_source_va\fP (const char *function, const char *filename, const char *format, uint8_tpriority, uint32_tlineno, uint32_ttags, va_listap)"
  527. +.SS "void \fBqb_log_init\fP (const char *name, int32_tfacility, uint8_tpriority)"
  528. .PP
  529. Init the logging system\&. \fBParameters:\fP
  530. .RS 4
  531. @@ -855,26 +812,20 @@ Init the logging system\&. \fBParameters
  532. .RE
  533. .PP
  534. -.SS "void qb_log_real_ (struct \fBqb_log_callsite\fP *cs, \&.\&.\&.)"
  535. -
  536. +.SS "void \fBqb_log_real_\fP (struct \fBqb_log_callsite\fP *cs, \&.\&.\&.)"
  537. .PP
  538. Internal function: use \fBqb_log()\fP or \fBqb_logt()\fP
  539. -.SS "void qb_log_real_va_ (struct \fBqb_log_callsite\fP *cs, va_listap)"
  540. -
  541. -.SS "void qb_log_tags_stringify_fn_set (\fBqb_log_tags_stringify_fn\fPfn)"
  542. -
  543. +.SS "void \fBqb_log_real_va_\fP (struct \fBqb_log_callsite\fP *cs, va_listap)"
  544. +.SS "void \fBqb_log_tags_stringify_fn_set\fP (\fBqb_log_tags_stringify_fn\fPfn)"
  545. .PP
  546. Set the callback to map the 'tags' bit map to a string\&.
  547. -.SS "void qb_log_target_format (int32_ttarget, struct \fBqb_log_callsite\fP *cs, time_ttimestamp, const char *formatted_message, char *output_buffer)"
  548. -
  549. +.SS "void \fBqb_log_target_format\fP (int32_ttarget, struct \fBqb_log_callsite\fP *cs, time_ttimestamp, const char *formatted_message, char *output_buffer)"
  550. .PP
  551. format the callsite and timestamp info according to the format set using \fBqb_log_format_set()\fP It is intended to be used from your custom logger function\&.
  552. -.SS "void* qb_log_target_user_data_get (int32_tt)"
  553. -
  554. +.SS "void* \fBqb_log_target_user_data_get\fP (int32_tt)"
  555. .PP
  556. Retrieve the user data set by either qb_log_custom_open or qb_log_target_user_data_set\&.
  557. -.SS "int32_t qb_log_target_user_data_set (int32_tt, void *user_data)"
  558. -
  559. +.SS "int32_t \fBqb_log_target_user_data_set\fP (int32_tt, void *user_data)"
  560. .PP
  561. Associate user data with this log target\&. \fBNote:\fP
  562. .RS 4
  563. @@ -882,8 +833,7 @@ only use this with custom targets
  564. .RE
  565. .PP
  566. -.SS "int32_t qb_log_thread_priority_set (int32_tpolicy, int32_tpriority)"
  567. -
  568. +.SS "int32_t \fBqb_log_thread_priority_set\fP (int32_tpolicy, int32_tpriority)"
  569. .PP
  570. When using threaded logging set the pthread policy and priority\&. \fBReturn values:\fP
  571. .RS 4
  572. @@ -893,32 +843,21 @@ When using threaded logging set the pthr
  573. .RE
  574. .PP
  575. -.SS "int32_t qb_log_thread_start (void)"
  576. -
  577. +.SS "int32_t \fBqb_log_thread_start\fP (void)"
  578. .PP
  579. Start the logging pthread\&.
  580. .SH "Variable Documentation"
  581. .PP
  582. -.SS "enum \fBqb_log_target_state\fP __attribute__"
  583. -
  584. -.SS "struct \fBqb_log_callsite\fP __start___verbose[]"
  585. -
  586. -.SS "struct \fBqb_log_callsite\fP __stop___verbose[]"
  587. -
  588. -.SS "const char* filename"
  589. -
  590. -.SS "const char* format"
  591. -
  592. -.SS "const char* function"
  593. -
  594. -.SS "uint32_t lineno"
  595. -
  596. -.SS "uint8_t priority"
  597. -
  598. -.SS "uint32_t tags"
  599. -
  600. -.SS "uint32_t targets"
  601. -
  602. +.SS "enum \fBqb_log_target_state\fP \fB__attribute__\fP"
  603. +.SS "struct \fBqb_log_callsite\fP \fB__start___verbose\fP[]"
  604. +.SS "struct \fBqb_log_callsite\fP \fB__stop___verbose\fP[]"
  605. +.SS "const char* \fBfilename\fP"
  606. +.SS "const char* \fBformat\fP"
  607. +.SS "const char* \fBfunction\fP"
  608. +.SS "uint32_t \fBlineno\fP"
  609. +.SS "uint8_t \fBpriority\fP"
  610. +.SS "uint32_t \fBtags\fP"
  611. +.SS "uint32_t \fBtargets\fP"
  612. .SH "Author"
  613. .PP
  614. Generated automatically by Doxygen for libqb from the source code\&.