## Overview Sometimes it is hard to debug eunit failures. This PR adds an ability to capture logs from the node while running the test case.
Two environment variables are added to control the behaviour of the logger. - EUNIT_LOG_FILE - to specify the log file - EUNIT_LOG_LEVEL - the verbosity level. Which MUST be one of: - debug - info - notice - warning - error - critical - alert - emergency If EUNIT_LOG_FILE is not specified the file backend for logger is disabled. Note: The logger is configured only for test cases which use `test_util:start_couch` function. If you want to enable the logger for other tests you would need to add `test_util:maybe_configure_file_logger()` call to `setup` function of the test. You also need to make sure that the `config` and `couch_log` apps are running. ## Testing recommendations 1. Test without configuring logger - `make eunit apps=couch` 2. Test with configured log file: - `EUNIT_LOG_FILE=test_log.log make eunit apps=couch` - check the test_log.log file - `EUNIT_LOG_FILE=/tmp/test_log.log make eunit apps=couch` - check the /tmp/test_log.log file 3. Test with configured log file and level - `EUNIT_LOG_FILE=test_log.log EUNIT_LOG_LEVEL=debug make eunit apps=couch` ## Related Issues or Pull Requests ## Checklist - [x] Code is written and works correctly; - [ ] Changes are covered by tests; - [ ] Documentation reflects the changes; [ Full content available at: https://github.com/apache/couchdb/pull/1637 ] This message was relayed via gitbox.apache.org for [email protected]
