SharpMod.Server.LogError C# (CSharp) Method

LogError() public static method

Logs an error message, uses date, mod, Error prefix.
public static LogError ( string message ) : void
message string /// Error message. ///
return void
        public static void LogError(string message)
        {
            MetaMod.MetaModEngine.metaUtilityFunctions.LogError(MetaMod.MetaModEngine.PLID, message);
        }

Usage Example

Beispiel #1
0
        public static void Init()
        {
            Version = new CVar("smod_version", "0.1");

            // load plugins

            Server.Print(License);
            Server.RegisterCommand("smod", smod);

            Verifier = new Verifier(Directory.GetCurrentDirectory(), Server.GameDirectory);

            try {
                var doc = new System.Xml.XmlDocument();
                doc.Load(Path.Combine(Server.ModDirectory, Path.Combine("cfg", "databases.xml")));
                try {
                    Database = DefaultDatabase.Load(Path.Combine(Server.ModDirectory, "SharpMod.Database.MySql.dll"));
                    Database.Load(doc);
                } catch (Exception e) {
                    Server.LogError("Database Interface failed to load, using default: {0}", e.Message);
                    Database = new DefaultDatabase();
                    Database.Load(doc);
                }
            } catch (Exception e) {
                Server.LogError("Failed to load cfg/databases.xml: {0}", e.Message);
            }

            Message.Init();
            MapCycle.Init();
        }