当前位置: 首页>>代码示例>>C#>>正文


C# Kernel.CreateLogger方法代码示例

本文整理汇总了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");
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:41,代码来源:OneServer.cs

示例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
                }
            }
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:43,代码来源:RemoteClient.cs

示例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;
        }
开发者ID:jsakamoto,项目名称:bjd5,代码行数:27,代码来源:Util.cs


注:本文中的Kernel.CreateLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。