本文整理汇总了C#中System.Logger类的典型用法代码示例。如果您正苦于以下问题:C# Logger类的具体用法?C# Logger怎么用?C# Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Logger类属于System命名空间,在下文中一共展示了Logger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
}
开发者ID:Sir-Odie,项目名称:CS-ELBot,代码行数:27,代码来源:PRIZECommandHandler.cs
示例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;
}
开发者ID:komelio,项目名称:Dimeng.LinkToMicrocad,代码行数:34,代码来源:PLINEMachiningToken.cs
示例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..."));
}
开发者ID:murple13,项目名称:Scrabble_CS3450,代码行数:7,代码来源:LoggerTests.cs
示例4: AppVeyor
public AppVeyor(Logger logger, IEnvironment environment, IHttpClientFactory httpClientFactory)
{
_logger = logger;
_environment = environment;
_httpClientFactory = httpClientFactory;
_appVeyorApiUrl = _environment.GetEnvironmentVariable("APPVEYOR_API_URL");
}
开发者ID:roh85,项目名称:vika,代码行数:7,代码来源:AppVeyor.cs
示例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>();
}
开发者ID:Souper07,项目名称:Autopilot,代码行数:7,代码来源:PlanetChecker.cs
示例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;
}
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:28,代码来源:CommandHost.cs
示例7: Entities_OnCloseAll
private static void Entities_OnCloseAll()
{
MyAPIGateway.Entities.OnCloseAll -= Entities_OnCloseAll;
MyAPIGateway.Multiplayer.UnregisterMessageHandler(ModID, ReceiveMessageUserSetting);
User = null;
staticLogger = null;
}
开发者ID:helppass,项目名称:Autopilot,代码行数:7,代码来源:UserSettings.cs
示例8: PostCheckBack
public PostCheckBack(string postLogPath, TimeSpan checkRate)
{
logger = new Logger<Post>(postLogPath);
chkRate = checkRate;
Task.Run(() => CheckPosts());
}
开发者ID:ArcticEcho,项目名称:Phamhilator,代码行数:7,代码来源:PostCheckBack.cs
示例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()");
}
开发者ID:deimosx6,项目名称:Autopilot,代码行数:28,代码来源:GuidedMissile.cs
示例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;
}
开发者ID:engina,项目名称:SharkIT,代码行数:60,代码来源:Download.cs
示例11: ManualMessage
public ManualMessage(IMyCubeBlock block)
{
m_logger = new Logger(GetType().Name, block);
m_block = block;
Registrar.Add(block, this);
}
开发者ID:Souper07,项目名称:Autopilot,代码行数:7,代码来源:ManualMessage.cs
示例12: Sensor
public Sensor(string Name, bool Simulation, Logger Logger)
{
this.Name = Name;
this.Simulation = Simulation;
this.logger = Logger;
LastMeasurements = new List<Measurement>();
}
开发者ID:gamondue,项目名称:GOR-4H-16,代码行数:7,代码来源:Sensor.cs
示例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);
}
开发者ID:Infinario,项目名称:c-sharp-sdk,代码行数:7,代码来源:State.cs
示例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;
}
开发者ID:Souper07,项目名称:Autopilot,代码行数:31,代码来源:Grinder.cs
示例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");
}
}
开发者ID:Rejendo,项目名称:orleans,代码行数:33,代码来源:ApplicationConfiguration.cs
示例16: ShouldFailOnMissingAuthAttribute
public void ShouldFailOnMissingAuthAttribute()
{
var logger = new Logger();
var builder = new AppBuilderFactory().Create();
builder.SetLoggerFactory(new LoggerFactory(logger));
var context = new OwinContext();
var request = (OwinRequest)context.Request;
request.Set<Action<Action<object>, object>>("server.OnSendingHeaders", RegisterForOnSendingHeaders);
request.Method = "get";
request.SetUri(new Uri("http://example.com:8080/resource/4?filter=a"));
request.SetHeader("Authorization", new string[] { "Hawk " +
"ts = \"1353788437\", mac = \"/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=\", ext = \"hello\""});
var response = (OwinResponse)context.Response;
response.StatusCode = 401;
var middleware = new HawkAuthenticationMiddleware(
new AppFuncTransition((env) =>
{
response.StatusCode = 401;
return Task.FromResult<object>(null);
}),
builder,
new HawkAuthenticationOptions
{
Credentials = GetCredential
}
);
middleware.Invoke(context);
Assert.AreEqual(401, response.StatusCode);
Assert.AreEqual("Missing attributes", logger.Messages[0]);
}
开发者ID:linkypi,项目名称:hawknet,代码行数:34,代码来源:HawkAuthenticationHandlerFixture.cs
示例17: RadioAntenna
public RadioAntenna(IMyCubeBlock block)
: base(block)
{
myLogger = new Logger("RadioAntenna", () => CubeBlock.CubeGrid.DisplayName);
myRadioAntenna = CubeBlock as Ingame.IMyRadioAntenna;
Registrar.Add(myRadioAntenna, this);
}
开发者ID:helppass,项目名称:Autopilot,代码行数:7,代码来源:RadioAntenna.cs
示例18: TextCommandsHandler
public TextCommandsHandler(TCPWrapper MyTCPWrapper, BasicCommunication.MessageParser MyMessageParser, HelpCommandHandler MyHelpCommandHandler, MySqlManager MyMySqlManager, Logger MyLogger)
{
this.TheTCPWrapper = MyTCPWrapper;
this.TheMessageParser = MyMessageParser;
this.TheHelpCommandHandler = MyHelpCommandHandler;
this.TheMySqlManager = MyMySqlManager;
this.TheLogger = MyLogger;
//this.CommandIsDisabled = MyMySqlManager.CheckIfCommandIsDisabled("#donate",Settings.botid);
string commands = TheMySqlManager.TextCommandlist(Settings.botid);
if (commands.Length == 0)
{
return;
}
string[] commandsarray = commands.Split(' ');
foreach (string command in commandsarray)
{
string paddedcommand = "";
if (command[0] != '#')
paddedcommand = "#";
paddedcommand = paddedcommand + command;
if (TheMySqlManager.CheckIfTextCommandIsDisabled(paddedcommand, Settings.botid) == false)
{
string text = TheMySqlManager.TextCommandHelpText(paddedcommand, Settings.botid);
TheHelpCommandHandler.AddCommand(paddedcommand + text);
}
}
TheMessageParser.Got_PM += new BasicCommunication.MessageParser.Got_PM_EventHandler(OnGotPM);
}
开发者ID:bignall,项目名称:CS-ELBot,代码行数:29,代码来源:TextCommandsHandler.cs
示例19: ImageProcessor
public ImageProcessor(StateColor setState, ShowState showState, TaskScheduler guiContext, Logger log)
{
_setState = setState;
_showState = showState;
GuiContext = guiContext;
_logger = log;
}
开发者ID:fire-eggs,项目名称:PHASH,代码行数:7,代码来源:ImageProcessor.cs
示例20: run
public static void run(String[] args)
{
Point a = new Point(49, 49);
Point b = new Point(0, 0);
Logger log = new Logger();
Stopwatch s = new Stopwatch();
log.addToLog("Initializing "+mapWidth+"x"+mapHeight+" map...");
initMap();
AStarMap map = new AStarMap(mapWidth, mapHeight, obstacleMap);
log.addToLog("Generating Bresenham's Line from "+a.x+","+a.y+" to "+b.x+","+b.y+"...");
s.Start();
List<Point> line = Bresenham.getCellsOnLine(a, b);
s.Stop();
log.addToLog("Generation took " + s.ElapsedMilliseconds + " ms");
String str = "";
foreach(Point point in line)
{
str = str+"("+point.x+","+point.y+") ";
}
log.addToLog("Line is:" + str);
log.addToLog("Writing line to map...");
log.addToLog("Printing map...");
new PrintMap(map, line);
}
开发者ID:gaopan461,项目名称:astar-java-csharp,代码行数:29,代码来源:TestBresenhamsLine.cs
注:本文中的System.Logger类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论