diff --git a/src/ska/logging/transactions.py b/src/ska/logging/transactions.py index 89a3959425ef1105432a7227ccde027f759f0ed6..43792de36734b65208e35f4024fdf30fffa84977 100644 --- a/src/ska/logging/transactions.py +++ b/src/ska/logging/transactions.py @@ -73,6 +73,9 @@ class Transaction: If there is a transaction ID in `params` and `transaction_id` is also passed in then the passed in `transaction_id` will take precedence. + However, if both transaction IDs provided in `params` and `transaction_id` are deemed + invalid (not a string or an empty string), then a new transaction ID will be generated. + By default the key `transaction_id` will be used to get a transaction ID out of `params`. If a different key is required then `transaction_id_key` can be specified. @@ -96,12 +99,11 @@ class Transaction: Raises ------ TransactionParamsError - If the `params` passed in is not valid. + If the `params` passed is not valid. """ if not isinstance(params, Mapping): raise TransactionParamsError("params must be dict-like (Mapping)") - if logger: self.logger = logger else: