Fix dialyzer warningsAdd `| undefined` to records that get initialized with not all their
fields set to the proper type (hence get the value undefined). These
fixes allow lager to exist as a dependency in a project and be filtered
through that project's dialyzer run without warnings.
Restore backwards-compatible `lager_file_backend` configurations.The strict configuration work in 31cf6c0 prevents some
backwards-compatible code in lager_file_backend from working as the
configuration is rejected before it gets to the backend. This fix adds
an additional guard on `check_handler_config/2` to support the `tuple`
configuration structure supported by `lager_file_backend`.
Fixed legacy support for {crash_log, undefined}Applications that explicitly configure lager's `crash_log` with the
value `undefined` will get a really terrible crash message for all
versions since 81222ca4869402b4b790bce3f2df40f9b2d213a0
Diff here: https://github.com/basho/lager/commit/81222ca4869402b4b790bce3f2df40f9b2d213a0#diff-25e915f0df09d04052d2a6e85b8824f2
That message looks like this:
```
** Generic server lager_crash_log termina...
* Undo unnecessary whitespace* Make lager_handler_watcher test more resilient by scanning for
messages of interest rather than assuming we know exactly what
messages will arrive at the test backend
Add a sleep to prevent losing race conditionLager logs its own application start up message. Previously
this message was discarded or not received quickly enough
to cause test failures, but now it seems as though it
is being received and causing several test failures
even though we are explicitly flushing it away.
We introduce a 5 millisecond sleep for several tests
to make sure the start up message is received before the
flush command ...
Overhaul start up and add killer configPreviously, configuration would come from application:get_env/3 or
proplists:get_value/3. Now we standardize on a single format
for retrieving values from the environment or from a proplist.
Force restart of system after a watcher kill.This is, perhaps, not the most ideal setup. It still ignores other
sinks but does bring logging back online after the appropriate delay.
Signed-off-by: Brian L. Troutwine <brian.troutwine@adroll.com>
Update test to not rely on sleep.This test only passes when run in isolation. That is, if you run the
suite solo everything is beautiful and nothing hurts. When run in the
group, it fails. By inspection it seems that no trace messages are
being sent and this causes the failure, for want of specific traces.
Signed-off-by: Brian L. Troutwine <brian.troutwine@adroll.com>
Attempt to redress test failures.At this point in the work, the killer will correctly stop the
DEFAULT_SINK in the event of overload but our friend never comes back
up and lager stops working past this point.
Oops!
Error message:
=SUPERVISOR REPORT==== 10-Mar-2016::16:18:11 ===
Supervisor: {local,lager_handler_watcher_sup}
Context: child_terminated
Reason: killed
Offender: [{pid,<0.63.0>},
...