Module roslua.logging
Logging facilities for roslua. This module provides the framework for logging messages. Multiple loggers can be registered which are called for output. Two submodules are provided for logging to stdout and to rosout. A convenience method overrides the internal print function and adds a few more for specific log levels for convenient logging.
Copyright© Tim Niemueller, Carnegie Mellon University, Intel Research Pittsburgh
Release: Released under BSD license
Functions
add_logger (logger) | Add a logger. |
print (...) | Print function replacement for loggers. |
print_debug (format, ...) | Print formatted. |
print_error (format, ...) | Print formatted. |
print_fatal (format, ...) | Print formatted. |
print_info (format, ...) | Print formatted. |
print_warn (format, ...) | Print formatted. |
printf (format, ...) | Print formatted. |
register_print_funcs (export_to) | Register print functions. |
remove_logger (logger) | Remove a logger. |
remove_stdout_logger () | Remove the stdout logger which is added by default. |
set_log_level (level) | Set the log level |
Functions
- add_logger (logger)
-
Add a logger.
Parameters
- logger: logger to add, must be a function that accepts three arguments, the log level (number), the time (Time instance), and the message (string)
- print (...)
-
Print function replacement for loggers. Can replace the standard print function and prints the given elements to loggers. Will be posted with INFO log level.
Parameters
- ...: variable number of string arguments
- print_debug (format, ...)
-
Print formatted. Prints a formatted string to loggers. Will be posted with DEBUG log level.
Parameters
- format: format string (cf. string.format() documentation)
- ...: appropriate arguments for format string
- print_error (format, ...)
-
Print formatted. Prints a formatted string to loggers. Will be posted with ERROR log level.
Parameters
- format: format string (cf. string.format() documentation)
- ...: appropriate arguments for format string
- print_fatal (format, ...)
-
Print formatted. Prints a formatted string to loggers. Will be posted with FATAL log level.
Parameters
- format: format string (cf. string.format() documentation)
- ...: appropriate arguments for format string
- print_info (format, ...)
-
Print formatted. Prints a formatted string to loggers. Will be posted with INFO log level.
Parameters
- format: format string (cf. string.format() documentation)
- ...: appropriate arguments for format string
- print_warn (format, ...)
-
Print formatted. Prints a formatted string to loggers. Will be posted with WARN log level.
Parameters
- format: format string (cf. string.format() documentation)
- ...: appropriate arguments for format string
- printf (format, ...)
-
Print formatted. Prints a formatted string to loggers. Will be posted with INFO log level.
Parameters
- format: format string (cf. string.format() documentation)
- ...: appropriate arguments for format string
- register_print_funcs (export_to)
-
Register print functions. In the given environment it overwrites the print function and adds printf, print_debug, print_info, print_warn, print_error, and print_fatal.
Parameters
- export_to: module or table to export to
- remove_logger (logger)
-
Remove a logger.
Parameters
- logger: logger to remove
- remove_stdout_logger ()
- Remove the stdout logger which is added by default.
- set_log_level (level)
-
Set the log level
Parameters
- level: log level. Anything of the same or a higher level is shown. Anything below is not.