Richard Hansen
60d1c53a36
Merge pull request #727 from rhansen/logger
...
Improvements to the new Logger class
2024-08-03 02:44:54 -04:00
Richard Hansen
43ea691e0c
Logger: Move log output to parentmost Logger
...
This makes it possible for tests to redirect log output so that they
can ensure that certain log messages are generated.
2024-08-02 21:37:14 -04:00
Richard Hansen
f4248d0617
Logger: Separate implementation from interface
...
This makes it easier to override the implementation for testing
purposes.
2024-08-02 21:14:37 -04:00
Richard Hansen
56f8c83d3a
Logger: Check label
for emptiness, not truthiness
2024-08-02 21:05:42 -04:00
Richard Hansen
0f094ac121
Logger: Check msg
and label
for definedness
2024-08-02 21:05:41 -04:00
Richard Hansen
15db76f739
Logger: Accept an arrayref of contexts for ctx
parameter
2024-08-02 20:42:36 -04:00
Richard Hansen
f36c2f45aa
Logger: Always use STDERR as output filehandle
...
There's no good reason for the caller of the `log` method to control
the output filehandle.
2024-08-02 17:03:56 -04:00
Richard Hansen
439b0fd0e1
Logger: Minimize STDERR override in tests
2024-08-02 17:00:00 -04:00
Richard Hansen
1bdd65e46e
Delete unused encode_base64
function
2024-08-02 16:13:56 -04:00
Richard Hansen
dff4cd4854
Logger: Localize override in test
2024-08-02 16:13:56 -04:00
Richard Hansen
37504fe6f2
Logger: Document the log
method
2024-08-02 16:13:56 -04:00
Richard Hansen
2e59e86df6
Merge pull request #725 from rhansen/logging
...
Add context to log messages
2024-07-31 01:03:25 -04:00
Richard Hansen
e036fd0cf6
logging: Use Logger contexts to improve log message readability
...
This also makes it easier to write useful log messages.
2024-07-31 01:01:00 -04:00
Richard Hansen
9e45aecf20
logging: New Logger class to generally handle context prefixes
2024-07-31 00:39:48 -04:00
Richard Hansen
23bc8cdac3
logging: Move colon from the label to logmsg
2024-07-31 00:39:48 -04:00
Richard Hansen
3262dd0952
logging: Rename pfx
to label
...
This is to prepare for a general log prefix mechanism to improve log
readability.
2024-07-31 00:39:48 -04:00
Richard Hansen
015600d72f
logging: Delete unused debug2
function
2024-07-31 00:39:47 -04:00
Richard Hansen
42d635c2df
dinahosting: Fix missing argument for log message format specifier
...
Also use string interpolation for readability and to reduce the
chances of reintroducing a bug like this in the future.
2024-07-31 00:39:47 -04:00
Richard Hansen
706ba713e0
porkbun: Fix IP version in success log message
...
Fixes a bug introduced in commit:
d8a23ff9a4
2024-07-31 00:39:47 -04:00
Richard Hansen
f5c59c2024
nsupdate: Log success/failure once for all hosts
2024-07-31 00:39:47 -04:00
Richard Hansen
0c2c97123f
namecheap: Log message improvements
2024-07-31 00:39:47 -04:00
Richard Hansen
71dc1f92e4
zoneedit1: Fix logged host names
2024-07-31 00:39:47 -04:00
Richard Hansen
9dce53ea4a
Merge pull request #724 from vladmovchan/master
...
Correct NoIP example
2024-07-31 00:37:41 -04:00
Vladyslav Movchan
af65dd86cf
Correct NoIP example
...
An extra comma in the example causes `401 Unauthorized` / `badauth`
2024-07-31 00:37:04 -04:00
Richard Hansen
9c5160a514
Whitespace fixes
2024-07-30 02:25:05 -04:00
Richard Hansen
5620127c71
Delete unnecessary comments
2024-07-30 02:24:27 -04:00
Richard Hansen
96ada0c79e
inwx: Add comment explaining why hostnames are not in update URL
2024-07-29 23:45:55 -04:00
Richard Hansen
32f95526f9
Merge pull request #723 from rhansen/infomaniak
...
infomaniak: Fix response status processing
2024-07-29 04:09:41 -04:00
Richard Hansen
d380e17aba
infomaniak: Fix response status processing
...
Previously, `nochg` responses were treated as failures and the logged
message for all responses was incorrect (either `undef` or "Unknown
reply from Infomaniak").
Background: Hash values are always scalars, so lists of values can
only be stored in hashes in arrayref form.
The following is legal but does not do what one might expect:
my %h = (
a => (1, 2),
b => (3, 4),
);
The `=>` operator is just a variant of the comma operator, and lists
in list context are flattened, so the above is equivalent to:
my %h = ('a', 1, 2, 'b', 3, 4);
which is equivalent to:
my %h = (
a => 1,
2 => 'b',
3 => 4,
);
which is obviously not what was intended.
2024-07-29 04:07:15 -04:00
Richard Hansen
3f0fd0f37b
infomaniak: Use variable interpolation instead of sprintf
...
for readability.
2024-07-29 04:02:42 -04:00
Richard Hansen
bb65b64e39
infomaniak: Whitespace fixes
2024-07-29 04:02:42 -04:00
Richard Hansen
2715743ee3
Merge pull request #721 from rhansen/gandi
...
`gandi` cleanups
2024-07-28 19:15:29 -04:00
Richard Hansen
0b30df4b69
gandi: Fix processing of PUT
error responses
...
Before, the returned JSON wasn't even parsed -- the error handling
code was reusing the parsed response from the earlier `GET`. Also, it
was reading object properties that were not documented in the Gandi
API documentation.
2024-07-28 19:04:30 -04:00
Richard Hansen
06c3dd5825
gandi: Invert condition to improve readability
2024-07-28 18:24:19 -04:00
Richard Hansen
6f505e6538
gandi: Inline an unnecessary variable
2024-07-28 18:24:19 -04:00
Richard Hansen
5e52f728ad
gandi: Use an array for headers for readability
2024-07-28 18:24:19 -04:00
Richard Hansen
a890b08935
gandi: Check for JSON object, not just definedness
2024-07-28 18:24:19 -04:00
Richard Hansen
b1ddaa0ce8
gandi: Log message improvements
2024-07-28 18:24:19 -04:00
Richard Hansen
12d5539abc
gandi: Don't ignore HTTP response code
2024-07-28 18:24:19 -04:00
Richard Hansen
325eb10536
gandi: Style fixes for readability
2024-07-28 18:24:19 -04:00
Richard Hansen
2ccdefff93
gandi: Whitespace fixes
2024-07-28 18:24:19 -04:00
Richard Hansen
15595d01ac
gandi: Delete unnecessary comment
2024-07-28 18:24:19 -04:00
Richard Hansen
26d7aa500a
Merge pull request #720 from rhansen/delete
...
Delete some unnecessary code
2024-07-28 18:22:19 -04:00
Richard Hansen
0fa7e132b1
logging: Delete now-unused verbose
function
2024-07-28 17:52:42 -04:00
Richard Hansen
54d381a18e
nsupdate: Convert some verbase
log messages to debug
2024-07-28 17:52:42 -04:00
Richard Hansen
61cc5d66ae
logging: Delete unnecessary verbose
calls
...
The same information (or more) is logged in the previous line.
2024-07-28 17:48:58 -04:00
Richard Hansen
ee0940175e
Delete redundant calls to failed
...
`header_ok` already calls `failed` if there's an error.
2024-07-28 03:45:10 -04:00
Richard Hansen
f410b915ce
Delete redundant checks
...
`header_ok` already asserts that the reply is defined and non-empty.
2024-07-28 03:45:10 -04:00
Richard Hansen
228efa7927
Merge pull request #719 from rhansen/cleanups
...
Various minor cleanups and improvements
2024-07-27 04:46:46 -04:00
Richard Hansen
fc453a0de3
porkbun: Check for JSON object, not just non-null
2024-07-27 04:40:34 -04:00