From bf7b41f548c51d6ee2d2df6c893ce29d2a00a443 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 29 Mar 2021 15:29:28 +0200 Subject: [PATCH] [libcalamares] Document the Once class for logging --- src/libcalamares/utils/Logger.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libcalamares/utils/Logger.h b/src/libcalamares/utils/Logger.h index 7b17754e8..b2e8cf0e8 100644 --- a/src/libcalamares/utils/Logger.h +++ b/src/libcalamares/utils/Logger.h @@ -290,6 +290,17 @@ operator<<( QDebug& s, const Pointer& p ) return s; } +/** @brief Convenience object for supplying SubEntry to a debug stream + * + * In a function with convoluted control paths, it may be unclear + * when to supply SubEntry to a debug stream -- it is convenient + * for the **first** debug statement from a given function to print + * the function header, and all subsequent onces to get SubEntry. + * + * Create an object of type Once and send it (first) to all CDebug + * objects; this will print the function header only once within the + * lifetime of that Once object. + */ class Once { public: