Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
adamralph committed Sep 13, 2019
1 parent a4bc6a0 commit 659b8f6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
17 changes: 17 additions & 0 deletions MinVer.Lib/NullLogger.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace MinVer.Lib
{
internal class NullLogger : ILogger
{
public bool IsTraceEnabled => false;

public bool IsDebugEnabled => false;

public void Debug(string message) { }

public void Info(string message) { }

public void Trace(string message) { }

public void Warn(int code, string message) { }
}
}
5 changes: 1 addition & 4 deletions MinVer.Lib/Versioner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ public static class Versioner
{
public static Version GetVersion(string repoOrWorkDir, string tagPrefix, MajorMinor minMajorMinor, string buildMeta, VersionPart autoIncrement, string defaultPreReleasePhase, ILogger log)
{
if (log == null)
{
throw new System.ArgumentNullException(nameof(log));
}
log = log ?? new NullLogger();

defaultPreReleasePhase = string.IsNullOrEmpty(defaultPreReleasePhase)
? "alpha"
Expand Down

0 comments on commit 659b8f6

Please sign in to comment.