초기커밋
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
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<string> m_server_types = new HashSet<string>();
|
||||
|
||||
// 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<string> ServerTypes { get => m_server_types; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user