當前位置: 首頁>>代碼示例>>C#>>正文


C# System.Logger類代碼示例

本文整理匯總了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);
            }
        }
開發者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


注:本文中的System.Logger類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。