summaryrefslogtreecommitdiff
path: root/NW4RTools/Logger.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NW4RTools/Logger.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/NW4RTools/Logger.cs b/NW4RTools/Logger.cs
index d5a76f3..a6fbb70 100644
--- a/NW4RTools/Logger.cs
+++ b/NW4RTools/Logger.cs
@@ -5,9 +5,9 @@ using System.Text;
namespace NW4RTools {
public class LogContext : IDisposable {
// An awful, awful hack
- private readonly Logger Owner;
+ private readonly ILogger Owner;
- public LogContext(Logger owner) {
+ public LogContext(ILogger owner) {
Owner = owner;
}
@@ -16,13 +16,21 @@ namespace NW4RTools {
}
}
- public class Logger {
+ public interface ILogger {
+ void Send(string format, params object[] args);
+ LogContext Push(string format, params object[] args);
+ void Pop();
+ void Block();
+ void Unblock();
+ }
+
+ public class ConsoleLogger : ILogger {
private List<string> PrefixElements;
private List<string> Names;
private int BlockCount;
private string Prefix;
- public Logger() {
+ public ConsoleLogger() {
Names = new List<string>();
Names.Add("root");