From 0ecdd341d70771e116ae039a612e170d0046df2b Mon Sep 17 00:00:00 2001 From: "Hsing-Yu (David) Chen" Date: Mon, 20 Feb 2023 17:19:12 -0800 Subject: [PATCH] docs: add more comment to logging.LoggerFunc - When tracing code, it was a bit hard to understand what the third parameter is. - The current comment should be enough to understand how to use LoggerFunc, and people who want to learn more can click into the doc link. Signed-off-by: Hsing-Yu (David) Chen --- runtime/v2/logging/logging.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/v2/logging/logging.go b/runtime/v2/logging/logging.go index e60c4e4fe..88cba1ffd 100644 --- a/runtime/v2/logging/logging.go +++ b/runtime/v2/logging/logging.go @@ -29,5 +29,9 @@ type Config struct { Stderr io.Reader } -// LoggerFunc is implemented by custom v2 logging binaries -type LoggerFunc func(context.Context, *Config, func() error) error +// LoggerFunc is implemented by custom v2 logging binaries. +// +// ready should be called when the logging binary finishes its setup and the container can be started. +// +// An example implementation of LoggerFunc: https://github.com/containerd/containerd/tree/main/runtime/v2#logging +type LoggerFunc func(ctx context.Context, cfg *Config, ready func() error) error