yumapro  21.10T-8
YumaPro SDK
log.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_log
13 #define _H_log
14 /* FILE: log.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
21 
22 
30 /********************************************************************
31 * *
32 * C H A N G E H I S T O R Y *
33 * *
34 *********************************************************************
35 
36 date init comment
37 ----------------------------------------------------------------------
38 08-jan-06 abb begun
39 28may12 mts Logging feature set mods
40 */
41 
42 
43 
44 
45 #include <stdio.h>
46 #include <xmlstring.h>
47 
48 #include "procdefs.h"
49 #include "status.h"
50 
51 #ifdef PTHREADS
52 #ifndef _H_thd
53 #include "thd.h"
54 #endif
55 #endif
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /********************************************************************
62 * *
63 * M A C R O S *
64 * *
65 *********************************************************************/
66 
67 #if defined(_XOPEN_SOURCE) || defined(CYGWIN) || defined(MACOSX)
68 #define uint uint32
69 #endif
70 
71 #if 0 // removed -- not threadsafe, may cause deadlocks
72 
73 /* THESE MACROS NOW DEFINED IN platform/procdefs.f
74  * ENTER_CS and EXIT_CS used instead
75  */
76 
77 #ifndef PTHREADS
78 /* NOP for non-threaded build */
79 #define LOG_ENTER_CS
80 #define LOG_EXIT_CS
81 #else
82 
83 /*
84  * Since multiple threads may call the logger at any time, access
85  * is synchronized via a mutex in order to prevent garbled output.
86  * In addition, a series of calls may be related (for example,
87  * val_dump_value() or trace_buff()). In order to allow nested calls
88  * on logger, a recursive "counting" mutex is used, allowing
89  * the owner to make multiple log calls in a "critical section".
90  *
91  * These are exported in order to allow the aforementioned calls
92  * from application code. (See val.c)
93  *
94  * Note that since the macros check for server vs client, these may
95  * be placed in common output code with no issues.
96  */
97 
98 #define LOG_ENTER_CS if (ncx_netconfd_running()) { \
99  if (thd_lock_recursive_log_cs_mutex()) \
100  { \
101  SET_ERROR(ERR_MUTEX_ERR); \
102  } \
103  }
104 
105 #define LOG_EXIT_CS if (ncx_netconfd_running()) { \
106  if (thd_unlock_recursive_log_cs_mutex()) \
107  { \
108  SET_ERROR(ERR_MUTEX_ERR); \
109  } \
110  }
111 
112 #endif // PTHREADS
113 #endif // 0
114 
115 /*
116  * Log internal errors to stderr. We can't call logger code to
117  * handle its own internal errors.
118  */
119 
120 /********************************************************************
121 * MACRO: LOG_INTERNAL_ERR
122 *
123 * Output string to stderr reporting error, function name, and line number
124 * and resulting action ...
125 *
126 * EXAMPLE:
127 *
128 * MACRO: LOG_INTERNAL_ERR(Null buf ptr, RETURN);
129 *
130 * OUTPUT: ERROR [log_util_init_buf@86]: Null buf ptr - RETURN
131 *
132 *
133 *********************************************************************/
134 #define LOG_INTERNAL_ERR(err_str, action) \
135  log_internal_err("\nERROR [%s@%d]: " #err_str " - " #action, \
136  __FUNCTION__, __LINE__)
137 
138 #define LOG_INTERNAL_LOCK_ERR(name, err_str, hndl, rc, action) \
139  log_internal_lock_err( \
140  "\nERROR [%s@%d]: [" #name "] " #err_str " (%p:%d) - " #action, \
141  __FUNCTION__, __LINE__, (void *)(hndl), rc)
142 
143 
144 /********************************************************************
145 * MACRO: LOG_INTERNAL_BUFF_ERR
146 *
147 * Output string to stderr reporting error, function name, and line number.
148 * Dump salient buffer descriptor state, and resulting action ...
149 *
150 * EXAMPLE:
151 *
152 * MACRO: LOG_INTERNAL_BUF_ERR(Bad buf, buf, remaining, REINIT);
153 *
154 * OUTPUT: ERROR [upd_log_buf@179]: Bad buf 'remaining' [ptr=81783a0, \
155 * id=4242, start=81783cc, end=81787cc, len=1024(0x400), \
156 * remaining=1024(0x400)]->remaining=400 - REINIT \
157 *
158 *********************************************************************/
159 #define LOG_INTERNAL_BUF_ERR(err_str, ptr, action) \
160  log_internal_err("\nERROR [%s@%d]: " #err_str \
161  " [ptr=%p, id=%4x, start=%p, end=%p" \
162  ", len=%u(0x%x), remaining=%d(0x%x)]" \
163  " wp=%u" " - %s\n", __FUNCTION__, __LINE__, \
164  ptr, (ptr)->idid, (ptr)->start, (ptr)->end, \
165  (ptr)->len, (ptr)->len, (ptr)->remaining, (ptr)->remaining, \
166  (uint)(ptr)->write_pending, #action)
167 
168 
169 /********************************************************************
170 * *
171 * C O N S T A N T S *
172 * *
173 *********************************************************************/
174 #define LOG_CLEANUP_PHASE1 FALSE
175 #define LOG_CLEANUP_PHASE2 !LOG_CLEANUP_PHASE1
176 
177 
178 /********************************************************************
179 * MACRO FILTER_DEBUG_LEVEL(lvl)
180 *
181 * Filter log calls at debug_level and syslog_level.
182 *
183 * Note: For efficiency, looks first at system_debug_level which is defined
184 * to be max of (debug_level, syslog_log_level, pthread_log_level).
185 * If system_debug_level indicates filtering, then no need to look
186 * at context specific debug levels.
187 *
188 * Note: pthread_log_level only exists in PTHREAD build
189 *
190 * INPUTS:
191 * lvl == debug level to inspect
192 *
193 * RETURNS:
194 * TRUE => filter
195 * FALSE => pass
196 *********************************************************************/
197 #define FILTER_DEBUG_LEVEL(lvl) \
198  ((log_get_system_log_level() < (lvl)) || \
199  ((log_get_log_level() < (lvl)) && \
200  (log_get_syslog_log_level() < (lvl))))
201 
202 #define ALLOW_DEBUG_LEVEL(lvl) !FILTER_DEBUG_LEVEL(lvl)
203 
204 #ifdef PTHREADS
205 /********************************************************************
206 * MACRO FILTER_PTHREAD_DEBUG_LEVEL(lvl)
207 *
208 * Filter pthread specific log calls at pthread_debug_level
209 *
210 * Note: For efficiency, looks first at system_debug_level which is defined
211 * to be max of (debug_level, syslog_log_level, pthread_log_level).
212 * If system_debug_level indicates filtering, then no need to look
213 * at context specific debug levels.
214 *
215 * Note: pthread_log_level only exists in PTHREAD build
216 *
217 * INPUTS:
218 * lvl == debug level to inspect
219 *
220 * RETURNS:
221 * TRUE => filter
222 * FALSE => pass
223 *********************************************************************/
224 #define FILTER_PTHREAD_DEBUG_LEVEL(lvl) \
225  ((log_get_system_log_level() < (lvl)) || \
226  (log_get_pthread_log_level() < (lvl)))
227 
228 #define ALLOW_PTHREAD_DEBUG_LEVEL(lvl) !FILTER_PTHREAD_DEBUG_LEVEL(lvl)
229 #endif
230 
231 
232 // Header only
233 
246 #define LOGDEV0 (log_get_system_log_level() >= LOG_DEBUG_DEV0)
247 
248  // BEGIN ncxlib/log/logmacros
264 
265 
266 
270 #define LOGERROR (log_get_system_log_level() >= LOG_DEBUG_ERROR)
271 
275 #define LOGWARN (log_get_system_log_level() >= LOG_DEBUG_WARN)
276 
280 #define LOGINFO (log_get_system_log_level() >= LOG_DEBUG_INFO)
281 
282 
283 #define LOGDEV1 (log_get_system_log_level() >= LOG_DEBUG_DEV1)
284 
288 #define LOGDEBUG (log_get_system_log_level() >= LOG_DEBUG_DEBUG)
289 
293 #define LOGDEBUG2 (log_get_system_log_level() >= LOG_DEBUG_DEBUG2)
294 
298 #define LOGDEBUG3 (log_get_system_log_level() >= LOG_DEBUG_DEBUG3)
299 
303 #define LOGDEBUG4 (log_get_system_log_level() >= LOG_DEBUG_DEBUG4)
304  // END ncxlib/log/logmacros
306 
307 
308 
309 /* macros to check pthread debug level only ... improves performance when
310  running without debugs enabled */
311 #define LOGDEV1_THD (log_get_pthread_log_level() >= LOG_DEBUG_DEV1)
312 #define LOGDBG_THD (log_get_pthread_log_level() >= LOG_DEBUG_DEBUG)
313 #define LOGDBG2_THD (log_get_pthread_log_level() >= LOG_DEBUG_DEBUG2)
314 #define LOGDBG3_THD (log_get_pthread_log_level() >= LOG_DEBUG_DEBUG3)
315 #define LOGDBG4_THD (log_get_pthread_log_level() >= LOG_DEBUG_DEBUG4)
316 
317  /* Ultra concise version */
318 #define DWRT LOG_DEBUG_WRITE
319 #define DEV0 LOG_DEBUG_DEV0
320 #define DERR LOG_DEBUG_ERROR
321 #define DWARN LOG_DEBUG_WARN
322 #define DINFO LOG_DEBUG_INFO
323 #define DEV1 LOG_DEBUG_DEV1
324 #define DBG LOG_DEBUG_DEBUG
325 #define DBG1 LOG_DEBUG_DEBUG
326 #define DBG2 LOG_DEBUG_DEBUG2
327 #define DBG3 LOG_DEBUG_DEBUG3
328 #define DBG4 LOG_DEBUG_DEBUG4
329 
330 #define LOG_DEBUG_STR_OFF (const xmlChar *)"off"
331 #define LOG_DEBUG_STR_WRITE (const xmlChar *)"write" /* "Force" output */
332 #define LOG_DEBUG_STR_DEV0 (const xmlChar *)"dev0" /* Special debugging */
333 #define LOG_DEBUG_STR_ERROR (const xmlChar *)"error"
334 #define LOG_DEBUG_STR_WARN (const xmlChar *)"warn"
335 #define LOG_DEBUG_STR_INFO (const xmlChar *)"info"
336 #define LOG_DEBUG_STR_DEV1 (const xmlChar *)"dev1" /* Special debugging */
337 #define LOG_DEBUG_STR_DEBUG (const xmlChar *)"debug"
338 #define LOG_DEBUG_STR_DEBUG2 (const xmlChar *)"debug2"
339 #define LOG_DEBUG_STR_DEBUG3 (const xmlChar *)"debug3"
340 #define LOG_DEBUG_STR_DEBUG4 (const xmlChar *)"debug4"
341 
342 /* syslog wants to know what app is calling ... */
343 #define LOG_DEBUG_APP_STR_UNKNOWN (const char *)"?yuma?"
344 #define LOG_DEBUG_APP_STR_YANGCLI (const char *)"yangcli-pro"
345 #define LOG_DEBUG_APP_STR_YANGDUMP (const char *)"yangdump-pro"
346 #define LOG_DEBUG_APP_STR_YANGDIFF (const char *)"yangdiff-pro"
347 #define LOG_DEBUG_APP_STR_NETCONFD (const char *)"netconfd-pro"
348 
349 /*
350  * Count to skip backtrace frames that are within the logging code ...
351  * these are usually not interesting or meaningful to the end user.
352  */
353 #define FRAME_OVERHEAD_CNT 4
354 
355 /********************************************************************
356 * *
357 * T Y P E S *
358 * *
359 *********************************************************************/
360  // BEGIN ncxlib/log/logtypes
369 
370 
374 typedef enum log_stream_t_ {
380 } log_stream_t;
381 
382 
386 typedef enum log_debug_t_ {
399 } log_debug_t;
400 
401 
405 typedef enum log_debug_app_t_ {
406  LOG_DEBUG_APP_NONE,
411  LOG_DEBUG_APP_MAX
413 
414  // END ncxlib/log/logtypes
416 
417 
418 
419 #define VALID_DEBUG_APP(app) \
420  ((app) > LOG_DEBUG_APP_NONE) && ((app) < LOG_DEBUG_APP_MAX)
421 
422 #define APP_IS_NETCONFD (log_get_debug_app() == LOG_DEBUG_APP_NETCONFD)
423 
424 /* logging function template to switch between
425  * log_stdout and log_write
426  */
427 typedef void (*logfn_void_t) (void);
428 
429 /*
430  * Function vectors to switch between native versus syslog (or
431  * vendor-specific) logging.
432  */
433 typedef void (*logfn_t) (const char *fstr, ...)
434  __attribute__ ((format (printf, 1, 2)));
435 
436 
437 /*
438  * log_common() and log_xxx_common()
439  */
440 typedef void (*logfn_cmn_va_t) (boolean recursive,
441  log_debug_t level, log_debug_t sub_level,
442  const char *fstr, va_list args);
443 
444 /*
445  * log_append() and log_xxx_append()
446  */
447 typedef void (*logfn_app_va_t) (boolean recursive,
448  log_debug_t level, log_debug_t sub_level,
449  const char *fstr, va_list args);
450  /* log_flush() and log_xxx_flush() */
451 typedef void (*logfn_flush_t) (void);
452  /* log_xxx_connect() */
453 typedef void (*logfn_connect_t) (void);
454  /* log_xxx_send() */
455 typedef void (*logfn_send_t) (log_debug_app_t app, log_debug_t level,
456  const char *fstr, ...)
457  __attribute__ ((format (printf, 3, 4)));
458 
459 
460 /* Accessed by log_syslog.c and log_vendor.c */
461 extern logfn_connect_t logfn_connect;
462 extern logfn_send_t logfn_send;
463 
464 /********************************************************************
465 * *
466 * V A R I A B L E S *
467 * *
468 *********************************************************************/
469 
470 
471 
472 /********************************************************************
473 * *
474 * F U N C T I O N S *
475 * *
476 *********************************************************************/
477 
478 /*
479 * Enforce logger critical section via logger mutex
480 */
481 extern void log_enter_cs ( void );
482 
483 
484 /*
485 * Enforce logger critical section via logger mutex
486 */
487 extern void log_exit_cs ( void );
488 
489  // BEGIN ncxlib/log/logfns
503 
504 
508 extern void disable_default_stdout(void);
509 
510 
514 extern void enable_default_stdout(void);
515 
516 
517 
518 
524 void
525  log_cleanup ( boolean phase2, boolean debugs );
526 
527 
528 /********************************************************************
529 * FUNCTION log_internal_err
530 *
531 * Send internal logging error info to stderr. This function is called
532 * when an error is detected while in the process of trying to send
533 * info via the logging stream.
534 *
535 * See also LOG_INTERNAL_ERR() and LOG_INTERNAL_BUF_ERR macros.
536 *
537 * INPUTS:
538 *
539 * fstr == format output string
540 * ... == variable argument list
541 *
542 * RETURNS:
543 * None
544 *********************************************************************/
545 void
546  log_internal_err (const char *fstr, ...)
547  __attribute__ ((format (printf, 1, 2)));
548 
549 void
550  log_internal_lock_err (const char *fstr, ...)
551  __attribute__ ((format (printf, 1, 2)));
552 
553 
554 /********************************************************************
555 * FUNCTIONs log_set_xxx and log_get_xxx
556 *
557 * Read/write support for the various (binary) --log-xxx config
558 * options above. Additional comments inline where noteworthy.
559 *
560 * INPUTS:
561 * None
562 *
563 * RETURNS:
564 * if log_get_xxx(), the requested configured value
565 *********************************************************************/
566 
567 /* Backtrace info level */
568 extern boolean
569  log_get_backtrace_detail (void);
570 extern void
571  log_set_backtrace_detail (void);
572 
573 /* --logheader="custom" */
574 extern void
575  log_set_custom (void);
576 
577 /* --log-header="localtime" */
578 extern void
579  log_set_localtime (void);
580 
581 /* --log-mirroring */
582 extern void
583  log_set_mirroring (void);
584 /* --log-mirroring */
585 extern boolean
586  log_get_mirroring (void);
587 
588 /* --log-stderr */
589 extern void
590  log_set_stderr (void);
591 
592 /* --log-suppress-ctrl */
593 extern void
594  log_set_suppress_ctrl (void);
595 
596 /* --log-syslog --log-vendor */
597 extern boolean
598  log_get_syslog_bfr_allocated (void);
599 
600 extern log_debug_t
601  log_syslog_log_level (void);
602 
603 /* --log-syslog --log-vendor */
604 extern boolean
605  log_get_vendor_bfr_allocated (void);
606 
607 /* --log-syslog --log-vendor */
608 extern void
609  log_set_syslog_bfr_allocated (void);
610 
611 /* --log-syslog --log-vendor */
612 extern void
613  log_set_vendor_bfr_allocated (void);
614 
615 /* --log-syslog --log-vendor */
616 extern void
617  log_clr_syslog_bfr_allocated (void);
618 
619 /* --log-syslog --log-vendor */
620 extern void
621  log_clr_vendor_bfr_allocated (void);
622 
623 /* --log-syslog */
624 extern void log_set_syslog (void);
625 extern void log_clr_syslog (void);
626 extern boolean log_get_syslog (void);
627 
628 /* --log-vendor */
629 extern void
630  log_set_vendor (void);
631 
632 /* --log-backtrace-stream="logfile" */
633 extern void
634  log_set_backtrace_logfile (void);
635 
636 /* --log-backtrace-stream="stderr" */
637 extern void
638  log_set_backtrace_stderr (void);
639 
640 /* --log-backtrace-stream="stdout" */
641 extern void
642  log_set_backtrace_stdout (void);
643 
644 /* --log-backtrace-stream="syslog" */
645 extern boolean
646  log_get_backtrace_syslog (void);
647 extern void
648  log_set_backtrace_syslog (void);
649 
650 /* --log-backtrace-stream="vendor" */
651 extern boolean
652  log_get_backtrace_vendor (void);
653 extern void
654  log_set_backtrace_vendor (void);
655 
656 
657 /********************************************************************
658  * FUNCTION log_set_backtrace
659 *
660 * Set the maximum frame count to report on a backtrace log entry
661 * (--log-backtrace=<frame_count>)
662 *
663 * INPUTS:
664 *
665 * frame_cnt == the requested frame count (if 0 then use internal default).
666 *
667 * RETURNS:
668 * None
669 *
670 *********************************************************************/
671 extern void
672  log_set_backtrace (uint frame_cnt);
673 
674 
675 /********************************************************************
676 * FUNCTIONs log_cvt_debug_level2bit
677 *
678 * Convert a debug level to a unique bit mask
679 *
680 * INPUTS:
681 *
682 * level == debug level enum to convert
683 *
684 * RETURNS:
685 * Unique bit mask
686 *
687 *********************************************************************/
688 extern uint
689  log_cvt_debug_level2bit (log_debug_t level);
690 
691 
692 /********************************************************************
693 * FUNCTIONs log_set_backtrace_level and log_clear_backtrace_level
694 *
695 * Manage the debug level bit mask to allow or restrict
696 * reporting of backtrace log entries
697 *
698 * INPUTS:
699 *
700 * log_set_backtrace_level: level == debug level for which backtrace
701 * log entries will be reported
702 *
703 * log_clear_backtrace_level: level == debug level for which backtrace
704 * log entries should no longer be reported
705 *
706 *
707 * RETURNS:
708 * none
709 *********************************************************************/
710 extern void
711  log_clear_backtrace_level (log_debug_t level);
712 
713 
714 extern void
715  log_set_backtrace_level (log_debug_t level);
716 
717 
718 /********************************************************************
719 * FUNCTION log_set_backtrace_level_mask
720 *
721 * Set the debug level bit mask to restrict reporting of backtrace info
722 *
723 * INPUTS:
724 * mask == bit mask respresenting debug levels for which to append
725 * backtrace info
726 *
727 * RETURNS:
728 * none
729 *********************************************************************/
730 extern void
731  log_set_backtrace_level_mask (uint mask);
732 
733 
734 /********************************************************************
735 * FUNCTIONs log_get_backtrace_level_mask
736 *
737 * Return the debug level bit mask in current use
738 *
739 * INPUTS:
740 * none
741 *
742 * RETURNS:
743 * mask == bit mask respresenting debug levels for which to append
744 * backtrace info
745 *********************************************************************/
746 extern uint
747  log_get_backtrace_level_mask (void);
748 
749 /********************************************************************
750 * FUNCTIONs log_test_backtrace_level
751 *
752 * Return whether a given debug level is enabled for backtrace
753 *
754 * INPUTS:
755 * level == debug level to test
756 *
757 * RETURNS:
758 * TRUE == backtrace enabled for level
759 * FALSE == backtrace disabled for level
760 *********************************************************************/
761 extern boolean
762  log_test_backtrace_level (log_debug_t level);
763 
764 
765 /********************************************************************
766 * FUNCTION log_do_backtrace
767 *
768 * Return the configured status for including backtrace info on a
769 * given output stream (e.g., logfile, syslog, stderr, etc.) at a
770 * given content level (e.g., error, warn, info, etc.).
771 *
772 * NOTE: Slightly funky. To use, pass the current (boolean) value
773 * of the config flag to be tested, along with the current
774 * content level (sub_level).
775 *
776 * INPUTS:
777 *
778 * sub_level == the content level for the log output
779 * flag == the --log-backtrace-stream flag to test
780 *
781 * RETURNS:
782 *
783 * TRUE == backtrace info should be generated
784 * FALSE == backtrace info should NOT be generated
785 *
786 *********************************************************************/
787 extern boolean
788  log_do_backtrace (log_debug_t sub_level, boolean flag);
789 
790 
806 extern status_t
807  log_open (const char *fname,
808  boolean append,
809  boolean tstamps);
810 
811 
817 extern void
818  log_close (void);
819 
820 
836 extern status_t
837  log_audit_open (const char *fname,
838  boolean append,
839  boolean tstamps);
840 
841 
847 extern void
848  log_audit_close (void);
849 
850 
856 extern boolean
857  log_audit_is_open (void);
858 
859 
870 extern status_t
871  log_alt_open (const char *fname);
872 
873 
886 extern status_t
887  log_alt_open_ex (const char *fname,
888  boolean overwrite);
889 
890 
896 extern void
897  log_alt_close (void);
898 
899 
907 extern void
908  log_init (void);
909 
910 
911 /********************************************************************
912 * FUNCTION log_common
913 *
914 * Generate "new" message log output, optionally pre-pended with an
915 * internal status header (date, time, level, etc). Additional info
916 * may be appended (via log_append()) on the same or subsequent lines.
917 *
918 * INPUTS:
919 * recursive == TRUE means this is a recursive callback from print_backtrace()
920 * level == internal logger "screening" level
921 * sub_level == internal logger functional (content) level
922 * fstr == format string in printf format
923 * args == any additional arguments for printf
924 *
925 * KLUDGE ALERT:
926 * For convenience we equate the 'recursive' param to a call from
927 * print_backtrace(), passing this information unvetted on to
928 * log_common_internal(). At present, this works because print_backtrace()
929 * is the ONLY routine to pass recursive as TRUE. Someday this may change.
930 *
931 *********************************************************************/
932 extern void
933  log_common (boolean recursive, log_debug_t level, log_debug_t sub_level,
934  const char *fstr, va_list args);
935 
936 
937 /*
938 * Append formatted string to the current logger output stream
939 *
940 * INPUTS:
941 * recursive == TRUE means this is a recursive callback from print_backtrace()
942 * level == internal logger "screening" level
943 * sub_level == internal logger functional (content) level
944 * fstr == format string in printf format
945 * args == additional arguments for printf
946 *
947 *********************************************************************/
948 extern void
949  log_append (boolean recursive, log_debug_t level, log_debug_t sub_level,
950  const char *fstr, va_list args);
951 
952 
964 extern void
965  log_flush (void);
966 
967 
968 /********************************************************************
969 * FUNCTION log_print_backtrace
970 *
971 * Print up to (array[] size) stack frame addresses
972 *
973 * INPUT:
974 *
975 * orig_sub_level == content level
976 * localfn_flush == flush call vector function
977 * max_detail == include maximum backtrace return information
978 * frame_overhead == number of frames in logger code (skip)
979 * preamble == prompt string to precede backtrace output
980 *
981 * RETURNS:
982 * none
983 *********************************************************************/
984 extern void
985  log_print_backtrace (boolean syslog_call,
986  log_debug_t orig_sub_level,
987  logfn_flush_t localfn_flush,
988  boolean max_detail,
989  uint frame_overhead,
990  const char *preamble);
991 
992 
993 /********************************************************************
994 * FUNCTION log_capture_backtrace
995 *
996 * Capture backtrace context for storage and later display. Used by
997 * chkheaps.c
998 *
999 * INPUT:
1000 * strP == ptr to a ptr to an array of printable strings describing the
1001 * backtrace represented by bt_arrayP. This memory MUST be
1002 * returned (via free()) by the caller.
1003 * bt_arrayP == ptr to a (pre-allocated) buffer of size sufficient
1004 * to hold max_frames backtrace addresses (void * ptrs).
1005 * max_frames == max frames to dump, preallocated and described by bt_arrayP
1006 *
1007 * RETURNS:
1008 * none
1009 *********************************************************************/
1010 extern uint
1011  log_capture_backtrace (char ***strP, void *bt_arrayP, uint max_frames);
1012 
1013 
1014 /********************************************************************
1015 * FUNCTION log_backtrace
1016 *
1017 * Output a string followed by backtrace detail, regardless of
1018 * backtrace setting.
1019 *
1020 * In general, use only for debugging ... should not be present in released
1021 * software (though it might be useful for debugging in the field).
1022 *
1023 * INPUTS:
1024 * level == output level
1025 * fstr == format string for log message
1026 * ... == variable arg list for format string
1027 *********************************************************************/
1028 extern void
1029  log_backtrace (log_debug_t level, const char *fstr, ...)
1030  __attribute__ ((format (printf, 2, 3)));
1031 
1032 
1033 /********************************************************************
1034 * FUNCTION log_stderr_backtrace
1035 *
1036 * Print up to (array[] size) stack frame addresses but output to STDERR.
1037 * This is useful for debugging within logger, e.g., when generating an
1038 * error internal to the logging subsystem. (See log_internal_err())
1039 *
1040 * INPUT:
1041 *
1042 * max_detail == include maximum backtrace return information
1043 * preamble == prompt string to precede backtrace output
1044 *
1045 * RETURNS:
1046 * none
1047 *********************************************************************/
1048 void
1049  log_stderr_backtrace (boolean max_detail, const char *preamble);
1050 
1051 
1062 extern void
1063  log_stdout (const char *fstr, ...)
1064  __attribute__ ((format (printf, 1, 2)));
1065 
1066 
1074 extern void
1075  log_stdout_level (log_debug_t level, const char *fstr, ...)
1076  __attribute__ ((format (printf, 2, 3)));
1077 
1078 
1089 extern void
1090  log_write (const char *fstr, ...)
1091  __attribute__ ((format (printf, 1, 2)));
1092 
1100 extern void
1101  log_write_append (const char *fstr, ...)
1102  __attribute__ ((format (printf, 1, 2)));
1103 
1104 
1105 extern void
1106  log_write_filtered (log_debug_t level, const char *fstr, ...)
1107  __attribute__ ((format (printf, 2, 3)));
1108 
1109 extern void
1110  log_write_filtered_append (log_debug_t level, const char *fstr, ...)
1111  __attribute__ ((format (printf, 2, 3)));
1112 
1113 extern void
1114  log_write_syslog_level (log_debug_t level, const char *fstr, ...)
1115  __attribute__ ((format (printf, 2, 3)));
1116 
1117 extern void
1118  log_write_syslog_level_append (log_debug_t level, const char *fstr, ...)
1119  __attribute__ ((format (printf, 2, 3)));
1120 
1121 
1130 extern void
1131  log_audit_write (const char *fstr, ...)
1132  __attribute__ ((format (printf, 1, 2)));
1133 
1134 
1143 extern void
1144  log_audit_write_level (log_debug_t level, const char *fstr, ...)
1145  __attribute__ ((format (printf, 2, 3)));
1146 
1147 
1148 /********************************************************************
1149 * FUNCTION log_audit_indent
1150 *
1151 * Printf a newline to the audit logfile,
1152 * then the specified number of space chars
1153 *
1154 * INPUTS:
1155 * indentcnt == number of indent chars, -1 == skip everything
1156 *
1157 *********************************************************************/
1158 extern void
1159  log_audit_indent (int32 indentcnt);
1160 
1161 extern void
1162  log_audit_indent_level (log_debug_t level, int32 indentcnt);
1163 
1164 
1171 extern void
1172  log_alt_write (const char *fstr, ...)
1173  __attribute__ ((format (printf, 1, 2)));
1174 
1175 
1183 extern void
1184  log_alt_write_level (log_debug_t level, const char *fstr, ...)
1185  __attribute__ ((format (printf, 2, 3)));
1186 
1187 
1188 
1189 /********************************************************************
1190 * FUNCTION log_alt_indent
1191 *
1192 * Printf a newline to the alternate logfile,
1193 * then the specified number of space chars
1194 *
1195 * INPUTS:
1196 * indentcnt == number of indent chars, -1 == skip everything
1197 *
1198 *********************************************************************/
1199 extern void
1200  log_alt_indent (int32 indentcnt);
1201 
1202 extern void
1203  log_alt_indent_level (log_debug_t level, int32 indentcnt);
1204 
1205 
1206 /********************************************************************
1207 * FUNCTION vlog_error
1208 *
1209 * Generate a LOG_DEBUG_ERROR log entry
1210 *
1211 * INPUTS:
1212 * fstr == format string in printf format
1213 * valist == any additional arguments for printf
1214 *
1215 *********************************************************************/
1216 void
1217  vlog_error (const char *fstr, va_list args );
1218 
1219 
1232 extern void
1233  log_error (const char *fstr, ...)
1234  __attribute__ ((format (printf, 1, 2)));
1235 
1236 
1244 extern void
1245  log_error_append (const char *fstr, ...)
1246  __attribute__ ((format (printf, 1, 2)));
1247 
1248 
1256 extern void
1257  log_warn (const char *fstr, ...)
1258  __attribute__ ((format (printf, 1, 2)));
1259 
1260 
1268 extern void
1269  log_warn_append (const char *fstr, ...)
1270  __attribute__ ((format (printf, 1, 2)));
1271 
1272 
1280 extern void
1281  log_info (const char *fstr, ...)
1282  __attribute__ ((format (printf, 1, 2)));
1283 
1284 
1292 extern void
1293  log_info_append (const char *fstr, ...)
1294  __attribute__ ((format (printf, 1, 2)));
1295 
1296 
1304 extern void
1305  log_debug (const char *fstr, ...)
1306  __attribute__ ((format (printf, 1, 2)));
1307 
1308 
1316 extern void
1317  log_debug_append (const char *fstr, ...)
1318  __attribute__ ((format (printf, 1, 2)));
1319 
1320 
1328 extern void
1329  log_debug2 (const char *fstr, ...)
1330  __attribute__ ((format (printf, 1, 2)));
1331 
1332 
1340 extern void
1341  log_debug2_append (const char *fstr, ...)
1342  __attribute__ ((format (printf, 1, 2)));
1343 
1344 
1352 extern void
1353  log_debug3 (const char *fstr, ...)
1354  __attribute__ ((format (printf, 1, 2)));
1355 
1356 
1364 extern void
1365  log_debug3_append (const char *fstr, ...)
1366  __attribute__ ((format (printf, 1, 2)));
1367 
1368 
1376 extern void
1377  log_debug4 (const char *fstr, ...)
1378  __attribute__ ((format (printf, 1, 2)));
1379 
1380 
1388 extern void
1389  log_debug4_append (const char *fstr, ...)
1390  __attribute__ ((format (printf, 1, 2)));
1391 
1392 
1393 /********************************************************************
1394 * FUNCTIONs log_dev0 and log_dev0_append
1395 *
1396 * Generate (append to) a LOG_DEBUG_DEV0 log entry
1397 *
1398 * NOTE: This level is intended primarily for debugging, where output related
1399 * issues at {ERROR, WARN, INFO} levels change program behavior)
1400 *
1401 * INPUTS:
1402 * fstr == format string in printf format
1403 * ... == any additional arguments for printf
1404 *
1405 *********************************************************************/
1406 extern void
1407  log_dev0 (const char *fstr, ...)
1408  __attribute__ ((format (printf, 1, 2)));
1409 
1410 extern void
1411  log_dev0_append (const char *fstr, ...)
1412  __attribute__ ((format (printf, 1, 2)));
1413 
1414 
1415 /********************************************************************
1416 * FUNCTIONs log_dev1 and log_dev1_append
1417 *
1418 * Generate (append to) a LOG_DEBUG_DEV1 log entry
1419 *
1420 * NOTE: This level is intended primarily for debugging, where output related
1421 * issues at {DEBUG, DEBUG2, DEBUG3, DEBUG4} change program behavior)
1422 *
1423 * INPUTS:
1424 * fstr == format string in printf format
1425 * ... == any additional arguments for printf
1426 *
1427 *********************************************************************/
1428 extern void
1429  log_dev1 (const char *fstr, ...)
1430  __attribute__ ((format (printf, 1, 2)));
1431 
1432 extern void
1433  log_dev1_append (const char *fstr, ...)
1434  __attribute__ ((format (printf, 1, 2)));
1435 
1436 
1437 /********************************************************************
1438 * FUNCTIONs log_write_level and log_write_level_append
1439 *
1440 * Generate (append to) a LOG_DEBUG_<LEVEL> log trace entry
1441 *
1442 * NOTE: Useful when the desired debug level is passed as a param
1443 *
1444 * INPUTS:
1445 * level == debug level
1446 * fstr == format string in printf format
1447 * ... == any additional arguments for printf
1448 *
1449 *********************************************************************/
1450 extern void
1451  log_write_level (log_debug_t level, const char *fstr, ...)
1452  __attribute__ ((format (printf, 2, 3)));
1453 
1454 extern void
1455  log_write_level_append (log_debug_t level, const char *fstr, ...)
1456  __attribute__ ((format (printf, 2, 3)));
1457 
1458 
1459 /********************************************************************
1460 * FUNCTIONs log_xxx_thd and log_xxx_append_thd
1461 *
1462 * Generate (or append to) a "thread" LOG_DEBUG_XXX level log entry
1463 *
1464 * INPUTS:
1465 * fstr == format string in printf format
1466 * ... == any additional arguments for printf
1467 *
1468 *********************************************************************/
1469 #ifdef PTHREADS
1470 extern void
1471  log_dev1_thd (const char *fstr, ...)
1472  __attribute__ ((format (printf, 1, 2)));
1473 
1474 extern void
1475  log_dev1_append_thd (const char *fstr, ...)
1476  __attribute__ ((format (printf, 1, 2)));
1477 
1478 extern void
1479  log_debug_thd (const char *fstr, ...)
1480  __attribute__ ((format (printf, 1, 2)));
1481 
1482 extern void
1483  log_debug_append_thd (const char *fstr, ...)
1484  __attribute__ ((format (printf, 1, 2)));
1485 
1486 extern void
1487  log_debug2_thd (const char *fstr, ...)
1488  __attribute__ ((format (printf, 1, 2)));
1489 
1490 extern void
1491  log_debug2_append_thd (const char *fstr, ...)
1492  __attribute__ ((format (printf, 1, 2)));
1493 
1494 extern void
1495  log_debug3_thd (const char *fstr, ...)
1496  __attribute__ ((format (printf, 1, 2)));
1497 
1498 extern void
1499  log_debug3_append_thd (const char *fstr, ...)
1500  __attribute__ ((format (printf, 1, 2)));
1501 
1502 extern void
1503  log_debug4_thd (const char *fstr, ...)
1504  __attribute__ ((format (printf, 1, 2)));
1505 
1506 extern void
1507  log_debug4_append_thd (const char *fstr, ...)
1508  __attribute__ ((format (printf, 1, 2)));
1509 #endif //#ifdef PTHREADS
1510 
1511 
1512 /********************************************************************
1513 * FUNCTION log_noop
1514 *
1515 * Do not generate any log message NO-OP
1516 * Used to set logfn_t to no-loggging option
1517 *
1518 * INPUTS:
1519 * fstr == format string in printf format
1520 * ... == any additional arguments for printf
1521 *
1522 *********************************************************************/
1523 extern void
1524  log_noop (const char *fstr, ...)
1525  __attribute__ ((format (printf, 1, 2)));
1526 
1527 
1533 extern void log_set_log_level (log_debug_t dlevel);
1534 
1540 extern void log_set_syslog_log_level (log_debug_t dlevel);
1541 
1542 
1543 #ifdef PTHREADS
1544 
1549 extern void log_set_pthread_log_level (log_debug_t dlevel);
1550 #endif // PTHREADS
1551 
1552 
1553 /*
1554 * FUNCTION log_get_system_log_level
1555 *
1556 * Get the global debug filter threshold level
1557 *
1558 * RETURNS:
1559 * the debug level
1560 *********************************************************************/
1561 extern log_debug_t log_get_system_log_level (void);
1562 
1563 
1569 extern log_debug_t log_get_log_level (void);
1570 
1571 
1577 extern log_debug_t log_get_syslog_log_level (void);
1578 
1579 
1585 extern log_debug_t log_get_pthread_log_level (void);
1586 
1587 
1588 /********************************************************************
1589 * FUNCTION log_get_debug_level_enum
1590 *
1591 * Get the corresponding debug enum for the specified string
1592 *
1593 * INPUTS:
1594 * str == string value to convert
1595 *
1596 * RETURNS:
1597 * the corresponding enum for the specified debug level
1598 *********************************************************************/
1599 extern log_debug_t
1600  log_get_debug_level_enum (const char *str);
1601 
1602 extern uint
1603  log_parse_debug_level_str (const char *str);
1604 
1605 
1606 /********************************************************************
1607 * FUNCTION log_get_debug_level_string
1608 *
1609 * Get the corresponding string for the debug enum
1610 *
1611 * INPUTS:
1612 * level == the enum for the specified debug level
1613 *
1614 * RETURNS:
1615 * the string value for this enum
1616 
1617 *********************************************************************/
1618 extern const xmlChar *
1619  log_get_debug_level_string (log_debug_t level);
1620 
1621 
1622 
1623 /********************************************************************
1624 * FUNCTION log_get_debug_level_value
1625 *
1626 * Get the corresponding YANG enum value for the debug enum
1627 *
1628 * INPUTS:
1629 * level == the enum for the specified debug level
1630 *
1631 * RETURNS:
1632 * the int32 value for this enum
1633 *********************************************************************/
1634 extern int32
1635  log_get_debug_level_value (log_debug_t level);
1636 
1637 
1638 /********************************************************************
1639 * FUNCTION log_get_debug_app_string
1640 *
1641 * Get the corresponding string for the debug app enum
1642 *
1643 * INPUTS:
1644 * app == the enum for the specified debug app
1645 *
1646 * RETURNS:
1647 * the string value for this enum
1648 
1649 *********************************************************************/
1650 extern const char *
1651  log_debug_get_app_string (log_debug_app_t app);
1652 
1653 /********************************************************************
1654 * FUNCTION log_debug_app2facility
1655 *
1656 * Translate from YumaPro app to syslog facility
1657 *
1658 * INPUTS:
1659 * app == the enum for the specified YUMA app
1660 *
1661 * RETURNS:
1662 * Appropriate syslog facility code
1663 *
1664 *********************************************************************/
1665 extern int
1666  log_debug_app2facility (log_debug_app_t app);
1667 
1668 
1669 /********************************************************************
1670 * FUNCTION log_set_debug_app
1671 *
1672 * Set syslog application level ... for example, yangcli will set
1673 * USER while netconfd will set DAEMON for use by syslog.
1674 *
1675 * INPUTS:
1676 * app == the enum for the specified YUMA app
1677 *
1678 * RETURNS:
1679 * None
1680 *
1681 *********************************************************************/
1682 extern void
1683  log_set_debug_app (log_debug_app_t app);
1684 
1685 
1686 /********************************************************************
1687 * FUNCTION log_get_debug_app
1688 *
1689 * Return syslog application level.
1690 *
1691 * INPUTS:
1692 * None
1693 *
1694 * RETURNS:
1695 * enum for the current YUMA app
1696 *
1697 *********************************************************************/
1698 extern log_debug_app_t
1699  log_get_debug_app (void);
1700 
1701 
1702 /********************************************************************
1703 * FUNCTION log_debug_app_string
1704 *
1705 * Return syslog application level string equivalent
1706 *
1707 * INPUTS:
1708 * None
1709 *
1710 * RETURNS:
1711 * String equivalent for the current YUMA app type
1712 *
1713 *********************************************************************/
1714 extern const char *
1715  log_debug_app_string (void);
1716 
1717 /********************************************************************
1718 * FUNCTION log_is_open
1719 *
1720 * Check if the logfile is active
1721 *
1722 * RETURNS:
1723 * TRUE if logfile open, FALSE otherwise
1724 *********************************************************************/
1725 extern boolean
1726  log_is_open (void);
1727 
1728 
1729 /********************************************************************
1730 * FUNCTION log_indent
1731 *
1732 * Printf a newline, then the specified number of chars
1733 *
1734 * INPUTS:
1735 * indentcnt == number of indent chars, -1 == skip everything
1736 *
1737 *********************************************************************/
1738 extern void
1739  log_indent (int32 indentcnt);
1740 extern void
1741  log_indent_append (int32 indentcnt);
1742 extern void
1743  log_indent_level_append (log_debug_t level, int32 indentcnt);
1744 
1745 
1746 /********************************************************************
1747 * FUNCTION log_stdout_indent
1748 *
1749 * Printf a newline to stdout, then the specified number of chars
1750 *
1751 * INPUTS:
1752 * indentcnt == number of indent chars, -1 == skip everything
1753 *
1754 *********************************************************************/
1755 extern void
1756  log_stdout_indent (int32 indentcnt);
1757 
1758 extern void
1759  log_stdout_level_indent (log_debug_t level, int32 indentcnt);
1760 
1761 
1762 /********************************************************************
1763 * FUNCTION log_get_logfile
1764 *
1765 * Get the open logfile for direct output
1766 * Needed by libtecla to write command line history
1767 *
1768 * RETURNS:
1769 * pointer to open FILE if any
1770 * NULL if no open logfile
1771 *********************************************************************/
1772 extern FILE *
1773  log_get_logfile (void);
1774 
1775 
1776 /********************************************************************
1777 * FUNCTION log_start_capture
1778 *
1779 * Open a capture logfile for writing
1780 *
1781 * INPUTS:
1782 * fname == full filespec string for capfile
1783 *
1784 * RETURNS:
1785 * status
1786 *********************************************************************/
1787 extern status_t
1788  log_start_capture (const char *fname);
1789 
1790 
1791 /********************************************************************
1792 * FUNCTION log_end_capture
1793 *
1794 * Close a capture logfile after writing
1795 *
1796 *********************************************************************/
1797 extern void
1798  log_end_capture (void);
1799 
1800 
1801 /********************************************************************
1802 * FUNCTION log_trigger_rotate
1803 *
1804 * Trigger the logrotate procedure
1805 *
1806 * RETURNS:
1807 * none
1808 *********************************************************************/
1809 extern void
1810  log_trigger_rotate (void);
1811 
1812 /********************************************************************
1813 * FUNCTION log_rotate_requested
1814 *
1815 * Check if logrotate procedure is in progress
1816 *
1817 * RETURNS:
1818 * TRUE if logrotate procedure has been started
1819 *
1820 *********************************************************************/
1821 extern boolean
1822  log_rotate_requested (void);
1823 
1824  // END ncxlib/log/logfns
1826 
1827 
1828 
1829 #ifdef __cplusplus
1830 } /* end extern 'C' */
1831 #endif
1832 
1833 #endif /* _H_log */
void log_alt_close(void)
Close the alternate logfile.
Definition: log.c:1286
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
void void void void log_warn_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_WARN log entry.
app is yangdiff
Definition: log.h:409
Output destined for logfile.
Definition: log.h:378
log_debug_t
The debug level enumerations used in util/log.c.
Definition: log.h:386
app is yangdump
Definition: log.h:408
Output destined for stderr.
Definition: log.h:377
void void void log_write(const char *fstr,...) __attribute__((format(printf
Write a new entry to the main log.
void void log_error_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_ERROR log entry.
void void log_stdout_level(log_debug_t level, const char *fstr,...) __attribute__((format(printf
Write output to STDOUT if debug level set.
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
void void void void log_write_append(const char *fstr,...) __attribute__((format(printf
Append to the last log entry to the main log.
debug level 1
Definition: log.h:395
void log_audit_close(void)
Close the audit_logfile.
Definition: log.c:1179
status_t log_alt_open_ex(const char *fname, boolean overwrite)
Open an alternate logfile for writing.
Definition: log.c:1250
void void void void void void void void void log_audit_write(const char *fstr,...) __attribute__((format(printf
Write an new entry to the audit log file.
void void void log_warn(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_WARN log entry.
value not set or error
Definition: log.h:375
Output destined for stdout.
Definition: log.h:376
void void void void void void void void void void void void void void void void void void void void void void void void void void void void void void void void log_set_log_level(log_debug_t dlevel)
Set the main log level.
Definition: log.c:3412
status_t log_alt_open(const char *fname)
Open an alternate logfile for writing.
Definition: log.c:1228
log_debug_t log_get_pthread_log_level(void)
Get the pthreads log level.
Definition: log.c:3577
app is yangcli
Definition: log.h:407
logging turned off
Definition: log.h:388
app is netconfd
Definition: log.h:410
void log_stdout(const char *fstr,...) __attribute__((format(printf
Write output to STDOUT.
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
void void void void void void log_info_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_INFO log entry.
debug level 4
Definition: log.h:398
void log_set_pthread_log_level(log_debug_t dlevel)
Set the pthreads log level.
Definition: log.c:3487
boolean log_audit_is_open(void)
Check if the audit log is open.
Definition: log.c:1207
log_debug_app_t
syslog wants to know what app is logging ...
Definition: log.h:405
void void void void void void void void void void void void void void log_debug4_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG4 log entry.
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
void log_flush(void)
Flush output buffers.
Definition: log.c:1897
void log_alt_write(const char *fstr,...) __attribute__((format(printf
Write to the alternate log file.
void void log_alt_write_level(log_debug_t level, const char *fstr,...) __attribute__((format(printf
Write to the alternate log file if debug-level set.
all previous + user info trace
Definition: log.h:393
log_debug_t log_get_log_level(void)
Get the main log level.
Definition: log.c:3525
status_t
global error return code
Definition: status_enum.h:186
void void void void void void void void log_debug_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG log entry.
void log_set_syslog_log_level(log_debug_t dlevel)
Set the syslog log level.
Definition: log.c:3455
void log_cleanup(boolean phase2, boolean debugs)
Final logger cleanup prior to restart or shutdown.
Definition: log.c:557
void log_close(void)
Close the logfile.
Definition: log.c:1123
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
logging turned on
Definition: log.h:389
status_t log_audit_open(const char *fname, boolean append, boolean tstamps)
Open the audit logfile for writing.
Definition: log.c:1161
Global error messages for status code enumerations.
fatal + internal errors only
Definition: log.h:391
void disable_default_stdout(void)
Used by yp-client to disable log.c output.
Definition: log.c:259
debug level 3
Definition: log.h:397
log_debug_t log_get_syslog_log_level(void)
Get the syslog log level.
Definition: log.c:3540
void void void void void void void void void void log_audit_write_level(log_debug_t level, const char *fstr,...) __attribute__((format(printf
Write an new entry to the audit log file if the log level is set.
void void void void void void void void void void log_debug2_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG2 log entry.
Output destined for capfile.
Definition: log.h:379
all errors + warnings
Definition: log.h:392
Special use developer debugging only.
Definition: log.h:390
value not set or error
Definition: log.h:387
Special use developer debugging only.
Definition: log.h:394
log_stream_t
The output stream enumerations used in util/log.c.
Definition: log.h:374
void enable_default_stdout(void)
Used by C program variants of yp-client to enable log.c output.
Definition: log.c:264
void log_init(void)
Initialize logger state.
Definition: log.c:532
Thread support (for now limited to netconfd)
status_t log_open(const char *fname, boolean append, boolean tstamps)
Open a logfile for writing.
Definition: log.c:1105
debug level 2
Definition: log.h:396
void void void void void void void void void void void void void log_debug4(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG4 log entry.