using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ServerCommon { [AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field)] public class BusinessLogEnumAttribute : Attribute { private string m_context = string.Empty; private LogCategoryType m_log_category = LogCategoryType.None; private LogSubCategoryType m_log_sub_category = LogSubCategoryType.None; // 해당 로그를 사용하는 서버 타입들 private HashSet m_server_types = new HashSet(); // enum public BusinessLogEnumAttribute(string context) { m_context = context; } // enum member public BusinessLogEnumAttribute(string context, LogCategoryType logCategory, LogSubCategoryType logSubCategory, params string[] server_types) : this(context) { m_log_category = logCategory; m_log_sub_category = logSubCategory; foreach (var each in server_types) { m_server_types.Add(each); } } public string Context { get => m_context; } public LogCategoryType LogCategory { get => m_log_category; } public LogSubCategoryType LogSubCategory { get => m_log_sub_category; } public HashSet ServerTypes { get => m_server_types; } } }