本文整理汇总了C#中Kernel.CreateLogger方法的典型用法代码示例。如果您正苦于以下问题:C# Kernel.CreateLogger方法的具体用法?C# Kernel.CreateLogger怎么用?C# Kernel.CreateLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kernel
的用法示例。
在下文中一共展示了Kernel.CreateLogger方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OneServer
//�R���X�g���N�^
protected OneServer(Kernel kernel, Conf conf, OneBind oneBind)
: base(kernel.CreateLogger(conf.NameTag,true,null))
{
Kernel = kernel;
NameTag = conf.NameTag;
Conf = conf;
_oneBind = oneBind;
IsJp = kernel.IsJp();
//Ver6.1.6
Lang = new Lang(IsJp ? LangKind.Jp : LangKind.En, "Server" + conf.NameTag);
CheckLang();//��`�̃e�X�g
//�e�X�g�p
if (Conf == null){
var optionSample = new OptionSample(kernel, "");
Conf = new Conf(optionSample);
Conf.Set("port", 9990);
Conf.Set("multiple", 10);
Conf.Set("acl", new Dat(new CtrlType[0]));
Conf.Set("enableAcl", 1);
Conf.Set("timeOut", 3);
}
//�e�X�g�p
if (_oneBind == null){
var ip = new Ip(IpKind.V4Localhost);
_oneBind = new OneBind(ip, ProtocolKind.Tcp);
}
Logger = kernel.CreateLogger(conf.NameTag, (bool)Conf.Get("useDetailsLog"), this);
_multiple = (int) Conf.Get("multiple");
//DHCP�ɂ�ACL�����݂��Ȃ�
if (NameTag != "Dhcp"){
//ACL���X�g ��`�������ꍇ�́AaclList�����Ȃ�
var acl = (Dat)Conf.Get("acl");
AclList = new AclList(acl, (int)Conf.Get("enableAcl"), Logger);
}
Timeout = (int) Conf.Get("timeOut");
}
示例2: RemoteClient
public RemoteClient(Kernel kernel)
: base(kernel.CreateLogger("RemoteClient",true,null))
{
_kernel = kernel;
var args = Environment.GetCommandLineArgs();
//this.kernel = kernel;
IsConected = false;
_logger = _kernel.CreateLogger("RemoteClient", true, this);
_optionFileName = string.Format("{0}\\{1}.ini", _kernel.ProgDir(), "$remote");
//Java fix IsJp�͌����_�ł͕s��
_kernel.Menu.InitializeRemote(true);//�ؒf���̌y�ʃ��j���[
//_kernel.Menu.OnClick += Menu_OnClick;
//�R�}���h���C�������̏���
if (args.Length != 2 && args.Length !=3) {
_logger.Set(LogKind.Error,null,1,string.Format("args.Length={0}",args.Length));
return;
}
//�ڑ���A�h���X
try{
_ip = new Ip(args[1]);
}catch(ValidObjException){
_logger.Set(LogKind.Error,null,2,string.Format("ip={0}", args[1]));
return;
}
//_ip = new Ip(args[1]);
//if (_ip.ToString() == "0.0.0.0") {
// _logger.Set(LogKind.Error,null,2,string.Format("ip={0}", args[1]));
// return;
//}
//�ڑ���|�[�g�ԍ�
if (args.Length == 3) {
try {
_port = Convert.ToInt32(args[2]);
} catch {
_logger.Set(LogKind.Error,null,3,string.Format("port={0}", args[2]));
_ip = new Ip(IpKind.V4_0);//���������s
}
}
}
示例3: CreateInstance
public static Object CreateInstance(Kernel kernel, string path, string className, Object[] param)
{
if (File.Exists(path)){
var dllName = Path.GetFileNameWithoutExtension(path);
try{
var asm = Assembly.LoadFile(path);
if (asm != null){
return asm.CreateInstance(dllName + "." + className, true, BindingFlags.Default, null, param,
null, null);
}
}
catch (Exception ex){
//Ver6.1.7
if (ex.InnerException != null) {
throw new Exception(ex.InnerException.Message);
}
var logger = kernel.CreateLogger("CreateInstance", false, null);
logger.Set(LogKind.Error, null, 9000051,
string.Format("DLL={0} CLASS={1} {2}", dllName, className, ex.Message));
return null;
}
}
return null;
}