-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from absynce/console-logging
Console logging
- Loading branch information
Showing
14 changed files
with
363 additions
and
117 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Castle.Core" version="3.3.3" targetFramework="net45" /> | ||
<package id="FluentAssertions" version="2.1.0.0" targetFramework="net45" /> | ||
<package id="Microsoft.Data.Edm" version="5.2.0" targetFramework="net45" /> | ||
<package id="Microsoft.Data.OData" version="5.2.0" targetFramework="net45" /> | ||
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" /> | ||
<package id="Moq" version="4.5.9" targetFramework="net45" /> | ||
<package id="RavenDB.Client" version="2.5.2700" targetFramework="net45" /> | ||
<package id="RavenDB.Database" version="2.5.2700" targetFramework="net45" /> | ||
<package id="RavenDB.Embedded" version="2.5.2700" targetFramework="net45" /> | ||
<package id="RavenDB.Tests.Helpers" version="2.5.2700" targetFramework="net45" /> | ||
<package id="System.Spatial" version="5.2.0" targetFramework="net45" /> | ||
<package id="WindowsAzure.Storage" version="2.0.6.1" targetFramework="net45" /> | ||
<package id="xunit" version="1.9.2" targetFramework="net45" /> | ||
<package id="xunit.runner.visualstudio" version="2.1.0" targetFramework="net45" /> | ||
</packages> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
|
||
namespace RavenMigrations | ||
{ | ||
public class ConsoleLogger : ILogger | ||
{ | ||
/// <summary> | ||
/// Writes an informational message to the log. | ||
/// </summary> | ||
/// <param name="format">The format.</param> | ||
/// <param name="args">The args.</param> | ||
public void WriteInformation(string format, params object[] args) | ||
{ | ||
Write(ConsoleColor.White, format, args); | ||
} | ||
|
||
/// <summary> | ||
/// Writes an error message to the log. | ||
/// </summary> | ||
/// <param name="format">The format.</param> | ||
/// <param name="args">The args.</param> | ||
public void WriteError(string format, params object[] args) | ||
{ | ||
Write(ConsoleColor.Red, format, args); | ||
} | ||
|
||
/// <summary> | ||
/// Writes a warning message to the log. | ||
/// </summary> | ||
/// <param name="format">The format.</param> | ||
/// <param name="args">The args.</param> | ||
public void WriteWarning(string format, params object[] args) | ||
{ | ||
Write(ConsoleColor.Yellow, format, args); | ||
} | ||
|
||
private static void Write(ConsoleColor color, string format, object[] args) | ||
{ | ||
Console.ForegroundColor = color; | ||
Console.WriteLine(format, args); | ||
Console.ResetColor(); | ||
} | ||
} | ||
} |
Oops, something went wrong.