helm-controller icon indicating copy to clipboard operation
helm-controller copied to clipboard

Add timestamps to captured Helm logs

Open hiddeco opened this issue 2 years ago • 3 comments

In #219 we started capturing Helm logs, the output at present could however be improved to make it easier to distinguish lines and provide indicators about for example the time it took for a sub action to run.

Current output:

Last Helm logs:

creating 8 resource(s)
beginning wait for 8 resources with timeout of 5m0s
Deployment is not ready: default/myapp-back. 0 out of 1 expected pods are ready

Improved example output:

Last Helm logs:

[<timestamp>] creating 8 resource(s)
[<timestamp>] beginning wait for 8 resources with timeout of 5m0s
[<timestamp>] Deployment is not ready: default/myapp-back. 0 out of 1 expected pods are ready

hiddeco avatar Aug 10 '21 11:08 hiddeco

I would like to give this a try.

pradeepnnv avatar Aug 10 '21 22:08 pradeepnnv

@pradeepnnv all yours, if you need help, just comment here :-).

hiddeco avatar Aug 11 '21 07:08 hiddeco

I wanted to give this a try but I'm not sure in which place I would add the timestamps. I would have added them in the LogBuffer.Log method, so that the recorded timestamps match the time they were logged. If I add them in wrapActionError or handleHelmActionResult, all timestamps of the individual captured messages will be the same, which is not what we want here, I assume.

Or maybe I was all wrong and there is another place where it needs to be added? Any hint is appreciated :)

peterfication avatar Apr 04 '22 14:04 peterfication