本文整理汇总了C#中System.Logger类的典型用法代码示例。如果您正苦于以下问题:C# Logger类的具体用法?C# Logger怎么用?C# Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Logger类属于System命名空间,在下文中一共展示了Logger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PRIZECommandHandler
public PRIZECommandHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser,HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Inventory MyInventory, TradeHandler MyTradeHandler, Stats MyStats, Logger MyLogger, ActorHandler MyActorHandler)
{
this.TheTCPWrapper = MyTCPWrapper;
this.TheMessageParser = MyMessageParser;
this.TheHelpCommandHandler = MyHelpCommandHandler;
this.TheMySqlManager = MyMySqlManager;
this.TheInventory = MyInventory;
this.TheTradeHandler = MyTradeHandler;
this.TheStats = MyStats;
this.TheActorHandler = MyActorHandler;
this.TheLogger = MyLogger;
this.TheTCPWrapper.GotCommand += new TCPWrapper.GotCommandEventHandler(OnGotCommand);
//this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#inv",Settings.botid);
//if (CommandIsDisabled == false)
{
if (Settings.IsTradeBot == true && TheMySqlManager.IGamble())
{
TheHelpCommandHandler.AddCommand("#prize - show my prize list");
TheHelpCommandHandler.AddCommand("#prizes - null");
}
TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
this.TheInventory.GotNewInventoryList += new Inventory.GotNewInventoryListEventHandler(OnGotNewInventoryList);
this.TheMessageParser.Got_AbortTrade += new BasicCommunication.MessageParser.Got_AbortTrade_EventHandler(OnGotAbortTrade);
}
}
示例2: Valid
public override bool Valid(Logger logger)
{
this.logger = logger;
base.faceNumberChecker(this.Token, 5, new int[] { 5, 6 });
this.checkPoints();
Bulges = base.pointsChecker(this.Par2);
//对Bulges不足的情况,用0补上
if (Bulges.Count < Points.Count)
{
for (int i = 0; i < Points.Count - Bulges.Count; i++)
{
Bulges.Add(0);
}
}
this.ToolName = base.notEmptyStringChecker(this.Par7, "PLINE/刀具名称");
ToolComp = base.toolCompChecker(this.Par8, "PLINE/刀具补偿");
if (this.FaceNumber == 5)
{
OnFace5 = true;
}
else if (this.FaceNumber == 6)
{
OnFace5 = false;
}
return this.IsValid;
}
示例3: LogMessageTest
public void LogMessageTest()
{
Scrabble.Logger tempLog = new Logger();
tempLog.LogMessage("Testing...");
string inFile = System.IO.File.ReadAllText(System.IO.Directory.GetCurrentDirectory() + "\\Logs\\" + tempLog.now + "_VERBOSE_LOG.txt");
Assert.IsFalse(inFile.Equals("Testing..."));
}
示例4: AppVeyor
public AppVeyor(Logger logger, IEnvironment environment, IHttpClientFactory httpClientFactory)
{
_logger = logger;
_environment = environment;
_httpClientFactory = httpClientFactory;
_appVeyorApiUrl = _environment.GetEnvironmentVariable("APPVEYOR_API_URL");
}
示例5: PlanetChecker
public PlanetChecker(IMyCubeGrid grid)
{
this.m_logger = new Logger(GetType().Name, grid.getBestName, ClosestPlanet.getBestName, CurrentState.ToString);
this.m_grid = grid;
this.m_cells = new MyQueue<Vector3I>(8);
this.m_cellsUnique = new HashSet<Vector3I>();
}
示例6: RunCommands
public CommandReturnCodes RunCommands(TextReader input, TextWriter output, Logger logger, IEnumerable<ResponseLine> responseLines) {
var agent = CreateAgent();
CommandReturnCodes result = StartHost(agent, input, output);
if (result != CommandReturnCodes.Ok)
return result;
foreach (var line in responseLines) {
logger.LogInfo("{0} ({1}): Running command: {2}", line.Filename, line.LineNumber, line.LineText);
var args = new OrchardParametersParser().Parse(new CommandParametersParser().Parse(line.Args));
result = (CommandReturnCodes)agent.GetType().GetMethod("RunCommand").Invoke(agent, new object[] {
input,
output,
args.Tenant,
args.Arguments.ToArray(),
args.Switches});
if (result != CommandReturnCodes.Ok) {
output.WriteLine("{0} ({1}): Command returned error ({2})", line.Filename, line.LineNumber, result);
return result;
}
}
result = StopHost(agent, input, output);
return result;
}
示例7: Entities_OnCloseAll
private static void Entities_OnCloseAll()
{
MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
MyAPIGateway.Multiplayer.UnregisterMessageHandler(ModID, ReceiveMessageUserSetting);
User = null;
staticLogger = null;
}
示例8: PostCheckBack
public PostCheckBack(string postLogPath, TimeSpan checkRate)
{
logger = new Logger<Post>(postLogPath);
chkRate = checkRate;
Task.Run(() => CheckPosts());
}
示例9: GuidedMissile
/// <summary>
/// Creates a missile with homing and target finding capabilities.
/// </summary>
public GuidedMissile(IMyEntity missile, IMyCubeBlock firedBy, TargetingOptions opt, Ammo ammo, LastSeen initialTarget = null, bool isSlave = false)
: base(missile, firedBy)
{
myLogger = new Logger("GuidedMissile", () => missile.getBestName(), () => m_stage.ToString());
myAmmo = ammo;
myDescr = ammo.Description;
if (ammo.Description.HasAntenna)
myAntenna = new MissileAntenna(missile);
TryHard = true;
AllGuidedMissiles.Add(this);
missile.OnClose += missile_OnClose;
if (myAmmo.IsCluster && !isSlave)
myCluster = new Cluster(myAmmo.MagazineDefinition.Capacity - 1);
accelerationPerUpdate = (myDescr.Acceleration + myAmmo.MissileDefinition.MissileAcceleration) / 60f;
addSpeedPerUpdate = myDescr.Acceleration / 60f;
Options = opt;
Options.TargetingRange = ammo.Description.TargetRange;
myTargetSeen = initialTarget;
myLogger.debugLog("Options: " + Options, "GuidedMissile()");
//myLogger.debugLog("AmmoDescription: \n" + MyAPIGateway.Utilities.SerializeToXML<Ammo.AmmoDescription>(myDescr), "GuidedMissile()");
}
示例10: Download
public Download(Uri uri, string key, CookieContainer cc, JObject song)
{
m_uri = uri;
m_key = key;
m_cc = cc;
m_song = song;
song["Status"] = "Opening file";
string filename = (string)song["ArtistName"] + " - " + (string)song["Name"] + ".mp3";
m_logger = new Logger(this.GetType().ToString() + " " + filename);
string dst = "";
string path = "";
if (Main.PATH.Length != 0)
path = Main.PATH + Path.DirectorySeparatorChar;
dst = path + filename;
try
{
m_path = dst;
m_fs = new FileStream(dst, FileMode.Create);
}
catch (Exception ex)
{
char[] invalf = Path.GetInvalidFileNameChars();
foreach (char c in invalf)
filename = filename.Replace(c, '_');
dst = path + filename;
try
{
m_path = dst;
m_fs = new FileStream(dst, FileMode.Create);
}
catch (Exception exc)
{
for (int i = 0; i < dst.Length; i++)
{
if (!Char.IsLetterOrDigit(dst[i]))
filename = filename.Replace(dst[i], '_');
dst = path + filename;
}
try
{
m_path = dst;
m_fs = new FileStream(dst, FileMode.Create);
}
catch (Exception exc2)
{
throw new Exception("Could not save the file buddy. (" + exc2.Message + ")");
}
}
}
m_logger.Info("Starting download");
song["Status"] = "Starting download";
Segment s = new Segment(uri, cc, key, 0, SEGMENT_SIZE-1, m_path);
m_segments.Add(s);
s.Progress += new EventHandler(s_Progress);
s.HeadersReceived += new Segment.HeadersReceivedHandler(s_HeadersReceived);
s.Start();
m_start = DateTime.Now;
}
示例11: ManualMessage
public ManualMessage(IMyCubeBlock block)
{
m_logger = new Logger(GetType().Name, block);
m_block = block;
Registrar.Add(block, this);
}
示例12: Sensor
public Sensor(string Name, bool Simulation, Logger Logger)
{
this.Name = Name;
this.Simulation = Simulation;
this.logger = Logger;
LastMeasurements = new List<Measurement>();
}
示例13: State
public State(string projectToken, string target, Logger logger, string workingDirectory)
{
this.projectToken = projectToken;
this.target = (target != null) ? target : Constants.DEFAULT_TARGET;
this.logger = (logger != null) ? logger : new NullLogger();
db = new Db(this.logger, workingDirectory);
}
示例14: Grinder
public Grinder(Mover mover, AllNavigationSettings navSet, float maxRange)
: base(mover, navSet)
{
this.m_logger = new Logger(GetType().Name, () => m_controlBlock.CubeGrid.DisplayName, () => m_stage.ToString());
this.m_startPostion = m_controlBlock.CubeBlock.GetPosition();
this.m_longestDimension = m_controlBlock.CubeGrid.GetLongestDim();
PseudoBlock navBlock = m_navSet.Settings_Current.NavigationBlock;
m_navGrind = navBlock.Block is Ingame.IMyShipGrinder
? new MultiBlock<MyObjectBuilder_ShipGrinder>(navBlock.Block)
: new MultiBlock<MyObjectBuilder_ShipGrinder>(() => m_mover.Block.CubeGrid);
if (m_navGrind.FunctionalBlocks == 0)
{
m_logger.debugLog("no working grinders", Logger.severity.INFO);
return;
}
m_grinderOffset = m_navGrind.Block.GetLengthInDirection(m_navGrind.Block.GetFaceDirection()[0]) * 0.5f + 2.5f;
if (m_navSet.Settings_Current.DestinationRadius > m_longestDimension)
{
m_logger.debugLog("Reducing DestinationRadius from " + m_navSet.Settings_Current.DestinationRadius + " to " + m_longestDimension, Logger.severity.DEBUG);
m_navSet.Settings_Task_NavRot.DestinationRadius = m_longestDimension;
}
this.m_finder = new GridFinder(m_navSet, mover.Block, maxRange);
this.m_finder.GridCondition = GridCondition;
m_navSet.Settings_Task_NavRot.NavigatorMover = this;
m_navSet.Settings_Task_NavRot.NavigatorRotator = this;
}
示例15: Load
/// <summary>
/// Load this configuratin from xml element.
/// </summary>
/// <param name="xmlElement"></param>
/// <param name="logger"></param>
public void Load(XmlElement xmlElement, Logger logger)
{
bool found = false;
foreach (XmlNode node in xmlElement.ChildNodes)
{
found = true;
var config = GrainTypeConfiguration.Load((XmlElement)node, logger);
if (null == config) continue;
if (config.AreDefaults)
{
defaults = config;
}
else
{
if (classSpecific.ContainsKey(config.FullTypeName))
{
throw new InvalidOperationException(string.Format("duplicate type {0} in configuration", config.FullTypeName));
}
classSpecific.Add(config.FullTypeName, config);
}
}
if (!found)
{
throw new InvalidOperationException("empty GrainTypeConfiguration element");
}
}