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


C# Logger.alwaysLog方法代码示例

本文整理汇总了C#中System.Logger.alwaysLog方法的典型用法代码示例。如果您正苦于以下问题:C# Logger.alwaysLog方法的具体用法?C# Logger.alwaysLog怎么用?C# Logger.alwaysLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Logger的用法示例。


在下文中一共展示了Logger.alwaysLog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Ammo

        private Ammo(MyAmmoMagazineDefinition ammoMagDef)
        {
            MyAmmoDefinition ammoDef = MyDefinitionManager.Static.GetAmmoDefinition(ammoMagDef.AmmoDefinitionId);
            this.myLogger = new Logger("Ammo", () => ammoMagDef.Id.ToString(), () => ammoDef.Id.ToString());

            this.AmmoDefinition = ammoDef;
            this.MissileDefinition = AmmoDefinition as MyMissileAmmoDefinition;
            this.MagazineDefinition = ammoMagDef;

            if (MissileDefinition != null && !MissileDefinition.MissileSkipAcceleration)
            {
                this.TimeToMaxSpeed = (MissileDefinition.DesiredSpeed - MissileDefinition.MissileInitialSpeed) / MissileDefinition.MissileAcceleration;
                this.DistanceToMaxSpeed = (MissileDefinition.DesiredSpeed + MissileDefinition.MissileInitialSpeed) / 2 * TimeToMaxSpeed;
            }
            else
            {
                this.TimeToMaxSpeed = 0;
                this.DistanceToMaxSpeed = 0;
            }

            Description = AmmoDescription.CreateFrom(AmmoDefinition);

            if (Description == null)
                return;

            if (Description.ClusterCooldown > 0f)
            {
                myLogger.debugLog("Is a cluster missile");
                IsCluster = true;
            }
            if (!string.IsNullOrWhiteSpace(Description.Radar))
            {
                try
                {
                    RadarDefinition = new RadarEquipment.Definition();
                    XML_Amendments<RadarEquipment.Definition> ammender = new XML_Amendments<RadarEquipment.Definition>(RadarDefinition);
                    ammender.primarySeparator = new char[] { ',' };
                    ammender.AmendAll(Description.Radar, true);
                    RadarDefinition = ammender.Deserialize();
                    myLogger.debugLog("Loaded description for radar", Logger.severity.DEBUG);
                }
                catch (Exception ex)
                {
                    Logger.debugNotify("Failed to load radar description for an ammo", 10000, Logger.severity.ERROR);
                    myLogger.alwaysLog("Failed to load radar description for an ammo", Logger.severity.ERROR);
                    myLogger.alwaysLog("Exception: " + ex, Logger.severity.ERROR);
                    RadarDefinition = null;
                }
            }
        }
开发者ID:Souper07,项目名称:Autopilot,代码行数:50,代码来源:Ammo.cs

示例2: CreateFrom

        private static WeaponDescription CreateFrom(MyCubeBlockDefinition definition)
        {
            if (string.IsNullOrWhiteSpace(definition.DescriptionString))
                return new WeaponDescription();

            WeaponDescription desc = new WeaponDescription();
            try
            {
                XML_Amendments<WeaponDescription> ammender = new XML_Amendments<WeaponDescription>(desc);
                ammender.AmendAll(definition.DescriptionString, true);
                return ammender.Deserialize();
            }
            catch (Exception ex)
            {
                Logger.debugNotify("Failed to load description for a weapon", 10000, Logger.severity.ERROR);
                Logger log = new Logger("WeaponDescription", () => definition.Id.ToString());
                log.alwaysLog("Failed to load description for a weapon", Logger.severity.ERROR);
                log.alwaysLog("Exception: " + ex, Logger.severity.ERROR);
                return new WeaponDescription();
            }
        }
开发者ID:Souper07,项目名称:Autopilot,代码行数:21,代码来源:WeaponDescription.cs

示例3: Facer

		/// <param name="mover">The mover to use</param>
		/// <param name="navSet">The settings to use</param>
		/// <param name="rotBlock">The block to rotate</param>
		public Facer(Mover mover, AllNavigationSettings navSet, PseudoBlock rotBlock)
			: base(mover, navSet)
		{
			this.m_logger = new Logger("Facer", m_controlBlock.CubeBlock);

			this.m_pseudoBlock = rotBlock;
			this.m_laser = rotBlock.Block as IMyLaserAntenna;
			if (this.m_laser == null)
			{
				if (!(rotBlock.Block is Ingame.IMySolarPanel) && !(rotBlock.Block is Ingame.IMyOxygenFarm))
				{
					m_logger.alwaysLog("Block is of wrong type: " + rotBlock.Block.DisplayNameText, "Facer()", Logger.severity.FATAL);
					throw new Exception("Block is of wrong type: " + rotBlock.Block.DisplayNameText);
				}
			}

			m_navSet.Settings_Task_NavRot.NavigatorRotator = this;
		}
开发者ID:helppass,项目名称:Autopilot,代码行数:21,代码来源:Facer.cs

示例4: Cluster

        public Cluster(IMyEntity master, Builder_Cluster builder)
        {
            this.m_logger = new Logger(GetType().Name);
            this.Master = master;
            this.MinOffMult = builder.MinOffMult;
            this.OffsetMulti = builder.OffsetMulti;
            this.masterVelocity = master.Physics.LinearVelocity;

            this.Slaves = new List<IMyEntity>(builder.Slaves.Length);
            this.SlaveOffsets = new List<Vector3>(builder.Slaves.Length);
            for (int index = 0; index < builder.Slaves.Length; index++)
            {
                IMyEntity slave;
                if (!MyAPIGateway.Entities.TryGetEntityById(builder.Slaves[index], out slave))
                {
                    m_logger.alwaysLog("Failed to get slave for " + builder.Slaves[index], Logger.severity.WARNING);
                    continue;
                }
                this.Slaves[index] = slave;
                this.SlaveOffsets[index] = builder.SlaveOffsets[index];
            }
        }
开发者ID:Souper07,项目名称:Autopilot,代码行数:22,代码来源:Cluster.cs


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