tree: d02d9182391c731fe718776be6d6efd1f2abd08b [path history] [tgz]
  1. meta/
  2. src/
  3. tests/
  4. BUILD.gn
  5. README.md
garnet/bin/logger/README.md

logger

Reviewed on: 2019-07-22

logger is the main logging service on Fuchsia. It provides the fuchsia.logger.LogSink service which components use to log messages, and the fuchsia.logger.Log service which log_listener uses to read back logs. It has a 4 MB rotating buffer in which all logs are stored. It also reads the kernel log and merges log messages from it into its buffer.

Building

This project can be added to builds by including --with //garnet/bin/logger to the fx set invocation.

Running

logger is started by sysmgr when something needs to log, and can also be reached by the log_listener command line tool.

Testing

Unit tests for logger are available in the logger_tests package.

Integration tests are also available in the logger_integration_tests package.

$ fx run-test logger_tests
$ fx run-test logger_integration_tests

Source layout

The entrypoint is located in src/main.rs, with the rest of the code living in src/*.rs files. Unit tests are co-located with the code and integration tests are located in the tests/ directory.