logging: Use Logger contexts to improve log message readability

This also makes it easier to write useful log messages.
This commit is contained in:
Richard Hansen 2024-07-24 18:40:44 -04:00
parent 9e45aecf20
commit e036fd0cf6
3 changed files with 359 additions and 353 deletions

View file

@ -72,6 +72,8 @@ repository history](https://github.com/ddclient/ddclient/commits/master).
different prefix to distinguish them from separate log messages. different prefix to distinguish them from separate log messages.
[#676](https://github.com/ddclient/ddclient/pull/676) [#676](https://github.com/ddclient/ddclient/pull/676)
[#719](https://github.com/ddclient/ddclient/pull/719) [#719](https://github.com/ddclient/ddclient/pull/719)
* Log messages now include context, making it easier to troubleshoot issues.
[#725](https://github.com/ddclient/ddclient/pull/725)
* `emailonly`: New `protocol` option that simply emails you when your IP * `emailonly`: New `protocol` option that simply emails you when your IP
address changes. [#654](https://github.com/ddclient/ddclient/pull/654) address changes. [#654](https://github.com/ddclient/ddclient/pull/654)
* `he.net`: Added support for updating Hurricane Electric records. * `he.net`: Added support for updating Hurricane Electric records.

File diff suppressed because it is too large Load diff

View file

@ -63,7 +63,7 @@ my @test_cases = (
for my $tc (@test_cases) { for my $tc (@test_cases) {
subtest $tc->{desc} => sub { subtest $tc->{desc} => sub {
$failmsg = ''; $failmsg = '';
is(ddclient::header_ok('host', $tc->{input}), $tc->{want}, 'return value matches'); is(ddclient::header_ok($tc->{input}), $tc->{want}, 'return value matches');
SKIP: { SKIP: {
skip('Test::MockModule not available') if !$have_mock; skip('Test::MockModule not available') if !$have_mock;
like($failmsg, $tc->{wantmsg} // qr/^$/, 'fail message matches'); like($failmsg, $tc->{wantmsg} // qr/^$/, 'fail message matches');