Skip to content

Instantly share code, notes, and snippets.

@rafaellucio
Last active January 1, 2018 00:57
Show Gist options
  • Save rafaellucio/6afc04441d68cf2ba67721d05be0a71d to your computer and use it in GitHub Desktop.
Save rafaellucio/6afc04441d68cf2ba67721d05be0a71d to your computer and use it in GitHub Desktop.
public class Logger
{
public void Success(string message)
{
Console.Write($"SUCCESS {message}");
}
public void Error(string message)
{
Console.Write($"ERROR {message}");
}
}
public class SingletonLogger {
private Logger instance = null;
private Logger CreateInstance() => new Logger();
public Logger GetInstance()
{
if (this.instance == null)
{
this.instance = this.CreateInstance();
}
return this.instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment