805320ce8f
This: - Implements caves with 3D noise - Moves periodic chunk updates to the thread pool - Fixes a handful of small bugs
38 lines
1.2 KiB
C#
38 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using TrueCraft.API.Logging;
|
|
|
|
namespace TrueCraft.Core.Logging
|
|
{
|
|
public static class LogHelpers
|
|
{
|
|
public static string GetTimestamp(bool utc = false, string timeFormat = "yyyy-MM-dd H:mm:ss", string suffix = " ")
|
|
{
|
|
return (utc ? DateTime.UtcNow : DateTime.Now).ToString(timeFormat) + suffix;
|
|
}
|
|
|
|
public static ConsoleColor GetCategoryColor(LogCategory category)
|
|
{
|
|
switch (category)
|
|
{
|
|
case LogCategory.Packets:
|
|
return ConsoleColor.White;
|
|
case LogCategory.Debug:
|
|
return ConsoleColor.Cyan;
|
|
case LogCategory.Warning:
|
|
return ConsoleColor.Yellow;
|
|
case LogCategory.Error:
|
|
return ConsoleColor.Red;
|
|
case LogCategory.Notice:
|
|
return ConsoleColor.Green;
|
|
case LogCategory.All:
|
|
return ConsoleColor.Magenta;
|
|
default:
|
|
return ConsoleColor.Gray;
|
|
}
|
|
}
|
|
}
|
|
}
|