mirror of
https://github.com/Ellpeck/ExtremelySimpleLogger.git
synced 2024-11-24 10:38:34 +01:00
expose the string sink's string builder
This commit is contained in:
parent
46bb08f60b
commit
5ab6fd855e
1 changed files with 13 additions and 2 deletions
|
@ -7,9 +7,8 @@ namespace ExtremelySimpleLogger {
|
|||
/// </summary>
|
||||
public class StringSink : Sink {
|
||||
|
||||
private readonly StringBuilder builder = new StringBuilder();
|
||||
/// <summary>
|
||||
/// The string that this sink currently contains.
|
||||
/// The string that this sink currently contains, constructed from the underlying <see cref="StringBuilder"/>.
|
||||
/// Can be cleared using <see cref="Clear"/>.
|
||||
/// </summary>
|
||||
public string Value {
|
||||
|
@ -18,6 +17,18 @@ namespace ExtremelySimpleLogger {
|
|||
return this.builder.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// The <see cref="StringBuilder"/> used to collect logged data from this sink.
|
||||
/// To get its value directly, you can use <see cref="Value"/>.
|
||||
/// </summary>
|
||||
public StringBuilder StringBuilder {
|
||||
get {
|
||||
lock (this.builder)
|
||||
return this.builder;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly StringBuilder builder = new StringBuilder();
|
||||
|
||||
/// <summary>
|
||||
/// Logs the given message, which has already been formatted using <see cref="Sink.Formatter"/>.
|
||||
|
|
Loading…
Reference in a new issue