Lines Matching +full:- +full:- +full:log +full:- +full:level
2 * logging.c - Centralised logging. Originated from the Linux-NTFS project.
5 * Copyright (c) 2005-2008 Szabolcs Szakacsits
6 * Copyright (c) 2010 Jean-Pierre Andre
19 * along with this program (in the main directory of the NTFS-3G
21 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
66 * struct ntfs_logging - Control info for the logging system
99 * ntfs_log_get_levels - Get a list of the current logging levels
103 * Returns: Log levels in a 32-bit field
111 * ntfs_log_set_levels - Enable extra logging levels
112 * @levels: 32-bit field of log levels to set
117 * Returns: Log levels that were enabled before the call
128 * ntfs_log_clear_levels - Disable some logging levels
129 * @levels: 32-bit field of log levels to clear
134 * Returns: Log levels that were enabled before the call
146 * ntfs_log_get_flags - Get a list of logging style flags
150 * Returns: Logging flags in a 32-bit field
158 * ntfs_log_set_flags - Enable extra logging style flags
159 * @flags: 32-bit field of logging flags to set
162 * The log flags are named: NTFS_LOG_LEVEL_*.
175 * ntfs_log_clear_flags - Disable some logging styles
176 * @flags: 32-bit field of logging flags to clear
179 * The log flags are named: NTFS_LOG_LEVEL_*.
193 * ntfs_log_get_stream - Default output streams for logging levels
194 * @level: Log level
201 static FILE * ntfs_log_get_stream(u32 level) in ntfs_log_get_stream() argument
205 switch (level) { in ntfs_log_get_stream()
230 * ntfs_log_get_prefix - Default prefixes for logging levels
231 * @level: Log level to be prefixed
237 static const char * ntfs_log_get_prefix(u32 level) in ntfs_log_get_prefix() argument
241 switch (level) { in ntfs_log_get_prefix()
282 * ntfs_log_set_handler - Provide an alternate logging handler
294 openlog("ntfs-3g", LOG_PID, LOG_USER); in ntfs_log_set_handler()
301 * ntfs_log_redirect - Pass on the request to the real handler
302 * @function: Function in which the log line occurred
303 * @file: File in which the log line occurred
304 * @line: Line number on which the log line occurred
305 * @level: Level at which the line is logged
307 * @format: printf-style formatting string
313 * Returns: -1 Error occurred
318 int line, u32 level, void *data, const char *format, ...) in ntfs_log_redirect() argument
324 if (!(ntfs_log.levels & level)) /* Don't log this message */ in ntfs_log_redirect()
329 ret = ntfs_log.handler(function, file, line, level, data, format, args); in ntfs_log_redirect()
338 * ntfs_log_handler_syslog - syslog logging handler
339 * @function: Function in which the log line occurred
340 * @file: File in which the log line occurred
341 * @line: Line number on which the log line occurred
342 * @level: Level at which the line is logged
344 * @format: printf-style formatting string
349 * Returns: -1 Error occurred
361 int line __attribute__((unused)), u32 level, in ntfs_log_handler_syslog() argument
369 if ((level & NTFS_LOG_LEVEL_PERROR) && errno == ENOSPC) in ntfs_log_handler_syslog()
379 if ((LOG_LINE_LEN > ret + 3) && (level & NTFS_LOG_LEVEL_PERROR)) { in ntfs_log_handler_syslog()
380 strncat(logbuf, ": ", LOG_LINE_LEN - ret - 1); in ntfs_log_handler_syslog()
381 strncat(logbuf, strerror(olderr), LOG_LINE_LEN - (ret + 3)); in ntfs_log_handler_syslog()
395 * (not quite satisfactory : this appears before the ntfs-g banner,
405 openlog("ntfs-3g", LOG_PID, LOG_USER); in ntfs_log_early_error()
416 * ntfs_log_handler_fprintf - Basic logging handler
417 * @function: Function in which the log line occurred
418 * @file: File in which the log line occurred
419 * @line: Line number on which the log line occurred
420 * @level: Level at which the line is logged
422 * @format: printf-style formatting string
425 * A simple logging handler. This is where the log line is finally displayed.
432 * Returns: -1 Error occurred
437 int line, u32 level, void *data, const char *format, va_list args) in ntfs_log_handler_fprintf() argument
451 if (level == NTFS_LOG_LEVEL_LEAVE) { in ntfs_log_handler_fprintf()
453 tab--; in ntfs_log_handler_fprintf()
465 ret += fprintf(stream, "%s", ntfs_log_get_prefix(level)); in ntfs_log_handler_fprintf()
474 (level & NTFS_LOG_LEVEL_TRACE) || (level & NTFS_LOG_LEVEL_ENTER)) in ntfs_log_handler_fprintf()
479 if (level & NTFS_LOG_LEVEL_PERROR) in ntfs_log_handler_fprintf()
483 if (level == NTFS_LOG_LEVEL_ENTER) in ntfs_log_handler_fprintf()
492 * ntfs_log_handler_null - Null logging handler (no output)
493 * @function: Function in which the log line occurred
494 * @file: File in which the log line occurred
495 * @line: Line number on which the log line occurred
496 * @level: Level at which the line is logged
498 * @format: printf-style formatting string
507 …int line __attribute__((unused)), u32 level __attribute__((unused)), void *data __attribute__((unu… in ntfs_log_handler_null() argument
514 * ntfs_log_handler_stdout - All logs go to stdout
515 * @function: Function in which the log line occurred
516 * @file: File in which the log line occurred
517 * @line: Line number on which the log line occurred
518 * @level: Level at which the line is logged
520 * @format: printf-style formatting string
523 * Display a log message to stdout.
530 * Returns: -1 Error occurred
535 int line, u32 level, void *data, const char *format, va_list args) in ntfs_log_handler_stdout() argument
540 return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); in ntfs_log_handler_stdout()
544 * ntfs_log_handler_outerr - Logs go to stdout/stderr depending on level
545 * @function: Function in which the log line occurred
546 * @file: File in which the log line occurred
547 * @line: Line number on which the log line occurred
548 * @level: Level at which the line is logged
550 * @format: printf-style formatting string
553 * Display a log message. The output stream will be determined by the log
554 * level.
561 * Returns: -1 Error occurred
566 int line, u32 level, void *data, const char *format, va_list args) in ntfs_log_handler_outerr() argument
569 data = ntfs_log_get_stream(level); in ntfs_log_handler_outerr()
571 return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); in ntfs_log_handler_outerr()
575 * ntfs_log_handler_stderr - All logs go to stderr
576 * @function: Function in which the log line occurred
577 * @file: File in which the log line occurred
578 * @line: Line number on which the log line occurred
579 * @level: Level at which the line is logged
581 * @format: printf-style formatting string
584 * Display a log message to stderr.
591 * Returns: -1 Error occurred
596 int line, u32 level, void *data, const char *format, va_list args) in ntfs_log_handler_stderr() argument
601 return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); in ntfs_log_handler_stderr()
606 * ntfs_log_parse_option - Act upon command line options
610 * with "--log-". Options cause log levels to be enabled in @ntfs_log (the
616 * FALSE Invalid log option
620 if (strcmp(option, "--log-debug") == 0) { in ntfs_log_parse_option()
623 } else if (strcmp(option, "--log-verbose") == 0) { in ntfs_log_parse_option()
626 } else if (strcmp(option, "--log-quiet") == 0) { in ntfs_log_parse_option()
629 } else if (strcmp(option, "--log-trace") == 0) { in ntfs_log_parse_option()