Terrarium.Server.InstallerInfo.WriteEventLog C# (CSharp) Méthode

WriteEventLog() public static méthode

public static WriteEventLog ( string id, string entry ) : void
id string
entry string
Résultat void
        public static void WriteEventLog(string id, string entry)
        {
            WriteEventLog(id, entry, EventLogEntryType.Error);
        }

Same methods

InstallerInfo::WriteEventLog ( string id, string entry, EventLogEntryType type ) : void

Usage Example

Exemple #1
0
        public string[] GetBlacklistedSpecies()
        {
            try {
                using (SqlConnection cnn = new SqlConnection(ServerSettings.SpeciesDsn)) {
                    cnn.Open();
                    using (SqlCommand cmd = new SqlCommand("Select AssemblyFullName From Species Where BlackListed = 1", cnn))
                        using (SqlDataReader dr = cmd.ExecuteReader()) {
                            List <String> blackListedSpecies = new List <String>();
                            while (dr.Read())
                            {
                                blackListedSpecies.Add(dr["AssemblyFullName"].ToString());
                            }

                            if (blackListedSpecies.Count > 0)
                            {
                                return(blackListedSpecies.ToArray());
                            }
                        }
                }
            } catch (Exception e) {
                InstallerInfo.WriteEventLog("GetBlacklistedSpecies", e.ToString());
                return(null);
            }

            return(null);
        }
All Usage Examples Of Terrarium.Server.InstallerInfo::WriteEventLog