From ca95bf53ad53f9143fa768cb3000d9e8cc54f3a0 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Fri, 3 Mar 2023 11:20:54 +0200 Subject: [PATCH] Core - Added documentation to missing functions Package - Added module documentation --- source/gogga/core.d | 38 +++++++++++++++++++++++++++++++++----- source/gogga/package.d | 3 +++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/source/gogga/core.d b/source/gogga/core.d index 5592db6..aef14f8 100644 --- a/source/gogga/core.d +++ b/source/gogga/core.d @@ -7,25 +7,49 @@ import std.array : join; import gogga.transform; import gogga.context; +/** + * The logging class which provides the logging print + * calls, controlling of style and whether to debug or + * not + */ public class GoggaLogger : Logger { - // The Gogga transformer + /** + * The custom transformer + */ private GoggaTransform gTransform = new GoggaTransform(); - // Whether debug is enabled + /** + * Whether debug prints are enabled or not + */ private bool debugEnabled = false; + /** + * Constructs a new GoggaLOgger + */ this() { super(gTransform); } + /** + * Our underlying logging implementation + * + * Params: + * text = the text to write + */ public override void logImpl(string text) { import std.stdio : write; write(text); } + /** + * Set the style of print outs + * + * Params: + * mode = the GoggaMode wanted + */ public void mode(GoggaMode mode) { gTransform.setMode(mode); @@ -210,13 +234,17 @@ public class GoggaLogger : Logger /* You can also call using `dbg` */ public alias dbg = debug_; - // Any calls to debugPrint will actually occur + /** + * Enables debug prints + */ public void enableDebug() { this.debugEnabled = true; - } + } - // Any calls to debugPrint will not occur + /** + * Disables debug prints + */ public void disableDebug() { this.debugEnabled = false; diff --git a/source/gogga/package.d b/source/gogga/package.d index 7832b97..490a3c6 100644 --- a/source/gogga/package.d +++ b/source/gogga/package.d @@ -1,3 +1,6 @@ +/** + * Gogga logging facilities + */ module gogga; public import gogga.core : GoggaLogger;