Merge pull request #896 from WhiteXZ/general-devel
DEBUG preprocessor checks for ILog
This commit is contained in:
commit
5f77f21e03
5 changed files with 14 additions and 4 deletions
|
|
@ -123,13 +123,13 @@ namespace TShockAPI
|
||||||
void Write(string message, TraceLevel level);
|
void Write(string message, TraceLevel level);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes a debug string to the log file.
|
/// Writes a debug string to the log file. Only works if the DEBUG preprocessor conditional is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The message to be written.</param>
|
/// <param name="message">The message to be written.</param>
|
||||||
void Debug(string message);
|
void Debug(string message);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes a debug string to the log file.
|
/// Writes a debug string to the log file. Only works if the DEBUG preprocessor conditional is set.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="format">The format of the message to be written.</param>
|
/// <param name="format">The format of the message to be written.</param>
|
||||||
/// <param name="args">The format arguments.</param>
|
/// <param name="args">The format arguments.</param>
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,8 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
ConsoleInfo(string.Format(format, args));
|
ConsoleInfo(string.Format(format, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Writes a debug string to the log file.
|
/// Writes a debug string to the log file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -175,6 +176,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
Debug(string.Format(format, args));
|
Debug(string.Format(format, args));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Internal method which writes a message directly to the log file.
|
/// Internal method which writes a message directly to the log file.
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,9 @@ namespace TShockAPI
|
||||||
/// <param name="message">The message to be written.</param>
|
/// <param name="message">The message to be written.</param>
|
||||||
public void Debug(string message)
|
public void Debug(string message)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Write(message, TraceLevel.Verbose);
|
Write(message, TraceLevel.Verbose);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -221,7 +223,9 @@ namespace TShockAPI
|
||||||
/// <param name="args">The format arguments.</param>
|
/// <param name="args">The format arguments.</param>
|
||||||
public void Debug(string format, params object[] args)
|
public void Debug(string format, params object[] args)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Debug(string.Format(format, args));
|
Debug(string.Format(format, args));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Write(string message, TraceLevel level)
|
public void Write(string message, TraceLevel level)
|
||||||
|
|
|
||||||
|
|
@ -849,7 +849,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (displayConsole)
|
if (displayConsole)
|
||||||
{
|
{
|
||||||
TShock.Log.ConsoleInfo("Player {0} has been disabled for {1}.", Name, reason);
|
TShock.Log.ConsoleInfo("Player {0} has been disabled for {1}.", Name, reason);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,9 @@ namespace TShockAPI
|
||||||
/// <param name="message">The message to be written.</param>
|
/// <param name="message">The message to be written.</param>
|
||||||
public void Debug(string message)
|
public void Debug(string message)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Write(message, TraceLevel.Verbose);
|
Write(message, TraceLevel.Verbose);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -188,7 +190,9 @@ namespace TShockAPI
|
||||||
/// <param name="args">The format arguments.</param>
|
/// <param name="args">The format arguments.</param>
|
||||||
public void Debug(string format, params object[] args)
|
public void Debug(string format, params object[] args)
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
Debug(string.Format(format, args));
|
Debug(string.Format(format, args));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue