Created
March 18, 2011 19:05
-
-
Save ntotten/876644 to your computer and use it in GitHub Desktop.
Facebook C# SDK Logging Mockup
This file contains 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 FacebookLogger { | |
private static readonly FacebookLogger Instance = new FacebookLogger(); | |
/// <summary> | |
/// Gets the current Facebook logger. | |
/// </summary> | |
public static IFacebookLogger Current | |
{ | |
get | |
{ | |
Contract.Ensures(Contract.Result<IFacebookLogger() != null); | |
return Instance.InnerCurrent; | |
} | |
} | |
public staic void SetLogger(IFacebookLogger facebookLogger { | |
// Implimetation | |
} | |
// Implimetation | |
// ... | |
// Default logger does nothing | |
private class NullFacebookLogger : IFacebookLogger { | |
// Implimentation | |
} | |
} | |
public interface IFacebookLogger { | |
void LogInformation(object msg); | |
void LogError(object msg); | |
void LogWarning(object msg); | |
} | |
// Logs to trace | |
public class TraceFacebookLogger : IFacebookLogger { | |
// Implimentation | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment