From 82171e4c4feb11df6919fa5657153e5b78ef2999 Mon Sep 17 00:00:00 2001 From: Geod24 Date: Mon, 21 Feb 2022 12:37:19 +0900 Subject: [PATCH] Log: Make Logger and Appender name property string In practice, they are always string, and not referring to some internal buffer. --- src/ocean/util/log/Appender.d | 4 ++-- src/ocean/util/log/ILogger.d | 2 +- src/ocean/util/log/InsertConsole.d | 2 +- src/ocean/util/log/Logger.d | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ocean/util/log/Appender.d b/src/ocean/util/log/Appender.d index 899195907..0f8ccc971 100644 --- a/src/ocean/util/log/Appender.d +++ b/src/ocean/util/log/Appender.d @@ -87,7 +87,7 @@ public class Appender abstract Mask mask (); /// Return the name of this Appender. - abstract cstring name (); + abstract string name (); /*************************************************************************** @@ -223,7 +223,7 @@ public class AppendNull : Appender } /// Return the name of this class - final override cstring name () + final override string name () { return this.classinfo.name; } diff --git a/src/ocean/util/log/ILogger.d b/src/ocean/util/log/ILogger.d index 675d84b50..063fac62c 100644 --- a/src/ocean/util/log/ILogger.d +++ b/src/ocean/util/log/ILogger.d @@ -169,7 +169,7 @@ interface ILogger ***************************************************************************/ - public cstring name (); + public string name (); /*************************************************************************** diff --git a/src/ocean/util/log/InsertConsole.d b/src/ocean/util/log/InsertConsole.d index d18dc37a6..87f53e376 100644 --- a/src/ocean/util/log/InsertConsole.d +++ b/src/ocean/util/log/InsertConsole.d @@ -118,7 +118,7 @@ public class InsertConsole: Appender ***********************************************************************/ - override cstring name ( ) + override string name ( ) { return this.classinfo.name; } diff --git a/src/ocean/util/log/Logger.d b/src/ocean/util/log/Logger.d index 0b9c76d2c..72f6fd3f8 100644 --- a/src/ocean/util/log/Logger.d +++ b/src/ocean/util/log/Logger.d @@ -425,7 +425,7 @@ public final class Logger : ILogger /// List of `Appender`s this Logger emits messages to private Appender appender_; /// Name of this logger - private string name_; + private string name_; /// Buffer to use for formatting. Can be `null`, see `buffer` properties private mstring buffer_; /// `Level` at which this `Logger` is configured @@ -610,7 +610,7 @@ public final class Logger : ILogger ***************************************************************************/ - public cstring name () + public string name () { auto i = this.name_.length; if (i > 0) @@ -1007,7 +1007,7 @@ unittest public Event[] result; public override Mask mask () { Mask m = 42; return m; } - public override cstring name () { return "BufferAppender"; } + public override string name () { return "BufferAppender"; } public override void append (LogEvent e) { this.result ~= Event(e.level, e.toString()); @@ -1042,7 +1042,7 @@ unittest private size_t index; public override Mask mask () { Mask m = 42; return m; } - public override cstring name () { return "StaticBufferAppender"; } + public override string name () { return "StaticBufferAppender"; } public override void append (LogEvent e) { assert(this.index < this.buffers.length);