More Elegant Solution to Logging Class
C# is not my main language, so I apologize for any mistakes that may exist in the following code.



There is quite a bit of duplication in this class. It seems like LogMessage(), EngineMessage() and ExceptionMessage() could all delegate to CustomMessage(). For example:

public static void LogMessage(string msg)
{
    CustomMessage("LOG", msg);
}

// etc ...




It also looks like the same string is being built twice in each function. It would be better to create the string once. Maybe something like this instead:

string logMsg = String.Format("[{0}][{1}]: {2}", EngineName, title, msg);
Console.WriteLine(logMsg);
logdata.Add(logMsg);




title.ToUpper();


Does this work? I would not expect this to modify the string in place, but rather return a new string. You probably need to do this:

title = title.ToUpper();




With the above changes:

public static void LogMessage(string msg)
{
    CustomMessage("LOG", msg);
}

public static void EngineMessage(string msg)
{
    CustomMessage("ENGINE", msg);
}

public static void ExceptionMessage(Exception e)
{
    CustomMessage("EXCEPTION", msg);
}

public static void CustomMessage(string title, string msg)
{
    string logMsg = String.Format("[{0}][{1}]: {2}", EngineName, title.ToUpper(), msg);
    Console.WriteLine(logMsg);
    logdata.Add(logMsg);
}