29 lines
591 B
C#
29 lines
591 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Wolf
|
|
{
|
|
public class Logger
|
|
{
|
|
private string _history = "";
|
|
|
|
public void Log(string message)
|
|
{
|
|
_history += message + "\n";
|
|
Console.WriteLine(message);
|
|
}
|
|
|
|
public string GetHistory()
|
|
{
|
|
return _history;
|
|
}
|
|
|
|
public string getLastLine()
|
|
{
|
|
string[] lines = _history.Split('\n', StringSplitOptions.RemoveEmptyEntries);
|
|
return lines.Length > 0 ? lines[^1] : "";
|
|
}
|
|
}
|
|
}
|