Skip to content

Commit

Permalink
Log: Make Logger and Appender name property string
Browse files Browse the repository at this point in the history
In practice, they are always string, and not referring to some internal buffer.
  • Loading branch information
Geod24 committed Feb 21, 2022
1 parent c7b23c1 commit 82171e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/ocean/util/log/Appender.d
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public class Appender
abstract Mask mask ();

/// Return the name of this Appender.
abstract cstring name ();
abstract string name ();

/***************************************************************************
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ocean/util/log/ILogger.d
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ interface ILogger
***************************************************************************/

public cstring name ();
public string name ();


/***************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/ocean/util/log/InsertConsole.d
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public class InsertConsole: Appender
***********************************************************************/

override cstring name ( )
override string name ( )
{
return this.classinfo.name;
}
Expand Down
8 changes: 4 additions & 4 deletions src/ocean/util/log/Logger.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -610,7 +610,7 @@ public final class Logger : ILogger
***************************************************************************/

public cstring name ()
public string name ()
{
auto i = this.name_.length;
if (i > 0)
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 82171e4

Please sign in to comment.