Skip to content

Instantly share code, notes, and snippets.

@ntotten
Created March 18, 2011 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntotten/876644 to your computer and use it in GitHub Desktop.
Save ntotten/876644 to your computer and use it in GitHub Desktop.
Facebook C# SDK Logging Mockup
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