本文整理汇总了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;
}
}
}
示例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();
}
}
示例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;
}
示例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];
}
}