From d610d2262b6e6acc3e9f76f05c7d4c34c128e179 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 27 Aug 2019 12:27:07 -0500 Subject: [PATCH] Add a Result.Log() method to aid in debugging --- src/LibHac/Result.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/LibHac/Result.cs b/src/LibHac/Result.cs index 86fcb228..86e90ba1 100644 --- a/src/LibHac/Result.cs +++ b/src/LibHac/Result.cs @@ -32,6 +32,17 @@ namespace LibHac } } + /// + /// A function that can contain code for logging or debugging returned results. + /// Intended to be used when returning a non-zero Result: + /// return result.Log(); + /// + /// The called value. + public Result Log() + { + return this; + } + public override bool Equals(object obj) { return obj is Result result && Equals(result);