Last active
January 1, 2018 00:57
-
-
Save rafaellucio/6afc04441d68cf2ba67721d05be0a71d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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