Add a function to allow statslog failure.

+ Record all types of failures which lead to log loss
+ Only record eventual failure after the retries to get a accurate log loss count.

Bug: 80538532
Test: manually tested

Change-Id: I23a55e62e140bf22ae5aa9e6c40539d51149cd66
Merged-In: I23a55e62e140bf22ae5aa9e6c40539d51149cd66
(cherry picked from commit ad3a40bf76b670878760738765154448772243fb)
4 files changed