本文整理汇总了C#中Bjd.Kernel.CreateLogger方法的典型用法代码示例。如果您正苦于以下问题:C# Kernel.CreateLogger方法的具体用法?C# Kernel.CreateLogger怎么用?C# Kernel.CreateLogger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bjd.Kernel
的用法示例。
在下文中一共展示了Kernel.CreateLogger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Agent
//public Agent(Server server, Kernel kernel, MailQueue mailQueue, SaveMail saveMail,bool always):base(kernel,"Agent") {
public Agent(Kernel kernel, Server server,Conf conf, Logger logger,MailQueue mailQueue, bool always)
: base(kernel.CreateLogger("Agent",true, null))
{
_conf = conf;
_logger = logger;
_mailQueue = mailQueue;
_always = always;
//�b��
_kernel = kernel;
_server = server;
}
示例2: OneAgent
public OneAgent(Kernel kernel, Server server,Conf conf,Logger logger, MailQueue mailQueue, OneQueue oneQueue)
: base(kernel.CreateLogger("OneAgent",true,null))
{
_conf = conf;
_logger = logger;
_mailQueue = mailQueue;
_oneQueue = oneQueue;
_smtpClient2 = new SmtpClient2();
//暫定
_kernel = kernel;
_server = server;
}
示例3: Initialization2
public Initialization2()
{
var tsDir = new TsDir();
//var tsOption = new TsOption(tsDir);
//var manageDir = tsDir.Src + "\\TestDir";
//TmpDir2 = string.Format("{0}/../../TestDir", Directory.GetCurrentDirectory());
var optionDef = tsDir.Src + "\\Option.def";
//Docs
Docs = new List<string>();
var lines = File.ReadAllLines(optionDef, Encoding.GetEncoding(932));
foreach (MlDocKind docKind in Enum.GetValues(typeof(MlDocKind))) {
var tag = string.Format("MEMO=Ml\b{0}Document=", docKind.ToString().ToLower());
bool hit = false;
foreach (var l in lines) {
if (l.IndexOf(tag) == 0) {
Docs.Add(l.Substring(tag.Length));
hit = true;
break;
}
}
if (!hit) {
Docs.Add("");
}
}
Kernel = new Kernel(null, null, null, null);
Logger = Kernel.CreateLogger("LOG", true, null);
domainList = new List<string>() { "example.com" };
MlAddr = new MlAddr(mlName, domainList);
var mailQueue = new MailQueue(tsDir.Src + "TestDir");
var oneOption = new Option(Kernel,"","");
var mailBox = new MailBox(Kernel, oneOption);
MailSave = new MailSave(Kernel,mailBox,Logger,mailQueue,"",domainList);
MlOption = CreateMlOption();
//MlUserList = CreateMlUsers();
Ml = new Ml(Kernel, Logger, MailSave, MlOption, mlName, domainList);
//30件のメールを保存
for (int i = 0; i < 30; i++) {
var mail = new Mail(null);
mail.Init(Encoding.ASCII.GetBytes("\r\n"));//区切り行(ヘッダ終了)
mail.AddHeader("subject", string.Format("[{0}:{1:D5}]TITLE", mlName, i + 1));
mail.Init(Encoding.ASCII.GetBytes("1\r\n"));//本文
mail.Init(Encoding.ASCII.GetBytes("2\r\n"));//本文
mail.Init(Encoding.ASCII.GetBytes("3\r\n"));//本文
Ml.Save(mail);
}
}
示例4: MlList
public MlList(Kernel kernel,Server server,MailSave mailSave, List<string> domainList)
{
var optionMl = kernel.ListOption.Get("Ml");
//メーリングストの一覧を取得する
var dat = (Dat) optionMl.GetValue("mlList");
if (dat != null){
foreach (var o2 in dat){
if (!o2.Enable)
continue;
//メーリングリスト名の読込
var mlName = o2.StrList[0];
var op = kernel.ListOption.Get("Ml-" + mlName);
var logger = kernel.CreateLogger(mlName, (bool) op.GetValue("useDetailsLog"), server);
var mlOption = new MlOption(kernel,op);
//無効なメンバ指定の確認と警告
foreach (var d in mlOption.MemberList){
var mailAddress = new MailAddress(d.StrList[1]); //メールアドレス
if (mailAddress.User != "" && mailAddress.Domain != "")
continue;
if (logger != null){
logger.Set(LogKind.Error, null, 53, string.Format("{0}", d.StrList[1]));
}
}
if (mlOption.MemberList.Count == 0){
logger.Set(LogKind.Error, null, 57, string.Format("{0}", mlName));
continue;
}
var ml = new Ml(kernel, logger, mailSave, mlOption, mlName, domainList);
//MLの管理領域の初期化に失敗している場合は、追加しない
if (!ml.Status)
continue;
_ar.Add(ml);
if (logger != null)
logger.Set(LogKind.Normal, null, 44, mlName);
}
}
}