[Logger] Add params overrides

This commit is contained in:
Matt Nadareski
2017-08-26 00:07:07 -07:00
parent ffadb57ed1
commit 6d0f347979

View File

@@ -250,6 +250,17 @@ namespace SabreTools.Library
return Log(output, LogLevel.VERBOSE, appendPrefix);
}
/// <summary>
/// Write the given string as a verbose message to the log output
/// </summary>
/// <param name="output">String to be written log</param>
/// <param name="args">Optional arguments for string formatting</param>
/// <returns>True if the output could be written, false otherwise</returns>s
public bool Verbose(string output, params object[] args)
{
return Log(string.Format(output, args), LogLevel.VERBOSE, true);
}
/// <summary>
/// Write the given string as a user message to the log output
/// </summary>
@@ -261,6 +272,17 @@ namespace SabreTools.Library
return Log(output, LogLevel.USER, appendPrefix);
}
/// <summary>
/// Write the given string as a user message to the log output
/// </summary>
/// <param name="output">String to be written log</param>
/// <param name="args">Optional arguments for string formatting</param>
/// <returns>True if the output could be written, false otherwise</returns>
public bool User(string output, params object[] args)
{
return Log(string.Format(output, args), LogLevel.USER, true);
}
/// <summary>
/// Write the given string as a warning to the log output
/// </summary>
@@ -273,6 +295,18 @@ namespace SabreTools.Library
return Log(output, LogLevel.WARNING, appendPrefix);
}
/// <summary>
/// Write the given string as a warning to the log output
/// </summary>
/// <param name="output">String to be written log</param>
/// <param name="args">Optional arguments for string formatting</param>
/// <returns>True if the output could be written, false otherwise</returns>
public bool Warning(string output, params object[] args)
{
_warnings = true;
return Log(string.Format(output, args), LogLevel.WARNING, true);
}
/// <summary>
/// Writes the given string as an error in the log
/// </summary>
@@ -285,6 +319,18 @@ namespace SabreTools.Library
return Log(output, LogLevel.ERROR, appendPrefix);
}
/// <summary>
/// Writes the given string as an error in the log
/// </summary>
/// <param name="output">String to be written log</param>
/// <param name="args">Optional arguments for string formatting</param>
/// <returns>True if the output could be written, false otherwise</returns>
public bool Error(string output, params object[] args)
{
_errors = true;
return Log(string.Format(output, args), LogLevel.ERROR, true);
}
/// <summary>
/// Clear lines beneath the given line in the console
/// </summary>