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


C# Logger.log方法代码示例

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


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

示例1: Main

        public static void Main(string[] args)
        {
            logger = new Logger(logFile);

            dataFetcher = new GetInfo();
            dataParser = new DataParser();
            imdbDataFetcher = new GetIMDBInfo();
            imdbDataParser = new IMDBDataParser();
            outputWriter = new OutputWriter();

            String[] movieDirectory = GetMovieNames();
            logger.log("Fetched [" + movieDirectory.Length.ToString() + "] movies");

            foreach (String moviePath in movieDirectory) {
                logger.flush();

                String movieName = moviePath.Replace(baseDirectory + "/", "");
                logger.log("Processing [" + movieName + "]");

                //Split out the directory name to get title and year
                DataFromFile dataFromFile = new DataFromFile(movieName);
                logger.log ("Split directory name to name [" + dataFromFile.getName() + "] and year [" + dataFromFile.getYear() + "]");

                //Grab rotten tomatoes data
                String rottenJson = dataFetcher.getData(movieName);
                rottenJson = rottenJson.Trim();
                MovieInfo rottenParsed = dataParser.getParsedData(rottenJson);

                if (rottenParsed == null) {
                    failedMovies.Add(movieName);
                    logger.log("Failed to get rottentomatoes data for movie [" + movieName + "]");
                    continue;
                }

                processMovieInfo(rottenParsed.Movies[0], dataFromFile, moviePath, failedMovies);
            }

            logger.closeLog();
        }
开发者ID:pipt,项目名称:rotten,代码行数:39,代码来源:Main.cs

示例2: XmppManager

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sJid">S jid.</param>
        /// <param name="sPassword">S password.</param>
        public XmppManager(AuthInfo authInfo, XmppServiceDescription xmppServiceDescription, OTRKeyRing _OTRKeyRing, OpenPGPRing _OpenPGPRing, ConversationManager _conversationManager, AddressBook _addressBook, Logger _logger)
        {
            try
            {
                m_Logger = _logger;
                m_OTRKeyRing = _OTRKeyRing;
                m_OpenPGPRing = _OpenPGPRing;
                m_AuthInfo = authInfo;
                m_OwnJid = new Jid (m_AuthInfo.m_sId);
                m_ClientConnection = new XmppClientConnection(m_OwnJid.Server);
                m_Contacts = new Dictionary<string, string> ();
                m_Logger.log(ELogLevel.LVL_INFO, "Trying to log in xmpp user", m_sModuleName);
                m_ClientConnection.Open(m_OwnJid.User, m_AuthInfo.m_sPassword);
                m_ConversationManager = _conversationManager;
                m_AddressBook = _addressBook;
                m_PresenceManager = new PresenceManager(m_AddressBook);
                m_OtrConnections = new Dictionary<string, int>();

                //register EventHandlers
                m_ClientConnection.OnLogin += new ObjectHandler(onLogin);
                m_ClientConnection.OnPresence += new PresenceHandler(OnPresence);
            }
            catch(Exception e) {
                Console.Write (e.Message);
            }

            //info: message callback is registered in onRosterItem callback
        }
开发者ID:crypto-ink,项目名称:CryptoInkLib,代码行数:33,代码来源:XmppManager.cs

示例3: Main

        /**********************************************************************
         *                                                                    *
         *                 Main()
         *                                                                    *
         **********************************************************************/
        /**
         <summary>
         Entry point of the experiment engine.
         </summary>
         <remarks> 
         insert detailed description for Main here...
         @cond INTERNAL
         documented by t.wilhelmer, 8.11.2015
         @endcond
         </remarks> 
         <param name="args">In/Out: description </param>
         <returns> return value description here </returns>
        */
        public static void Main(string[] args)
        {
            ExperimentEngine engine = new ExperimentEngine();
            bool noException = true;
            RestAPI restAPI = new RestAPI(Authorize.xapikey, Authorize.userID);
            Logger logger = new Logger();

            Status status = Status.CHECKFOREXPERIMENT;
            while (noException == true)
            {
                switch (status)
                {
                    case Status.CHECKFOREXPERIMENT:
                        logger.log("Checking for a new experiment");
                        while (status == Status.CHECKFOREXPERIMENT)
                        {
                            Console.WriteLine("Waiting for experiment.");
                            Thread.Sleep(3000);
                            status = engine.checkForNewExperiment(restAPI);
                        }
                        break;
                    case Status.DEQUEUEEXPERIMENT:
                        Console.WriteLine("Dequeue experiment.");
                        status = engine.dequeueExperiment(restAPI);
                        break;

                    case Status.PERFORMEXPERIMENT:
                        Console.WriteLine("Perform experiment.");
                        status = engine.performExperiment();
                        //Entering point for experiment calculations etc.
                        break;

                    case Status.RETURNDATA:
                        Console.WriteLine("Return experiment data.");
                        status = engine.returnData(restAPI);
                        break;

                    //case Status.RELEASEENGINE:
                    //    status = releaseEngine(client);
                    //    break;

                    case Status.ERROR:
                        Console.WriteLine("A \"success\" parameter was returned as \"false\"");
                        logger.log("An error occurred: errorReport:" + engine.errorReport);
                        logger.log("Restarting state machine. \n");
                        logger.errorLog("An internal error occurred. Please see EvaluationLog.txt for more details.");
                        status = engine.abortExperiment(restAPI, engine.errorReport);
                        break;

                    case Status.EXCEPTION:
                        noException = false;
                        Console.WriteLine("An exception occurred. Please check the ErrorLog.txt for more details.");
                        break;

                    default:
                        status = Status.EXCEPTION;
                        logger.errorLog("A undefined state of the state machine has been called.");
                        break;
                }
            }
        }
开发者ID:OnlineLabs4All,项目名称:CS_Template_Engine,代码行数:79,代码来源:StateMachine.cs

示例4: Test_01_Setup

        /// <summary>
        /// Tests 01 setup.
        /// </summary>
        private static void Test_01_Setup()
        {
            AssetManager.Instance.Bridge = bridge2;

            //! Add assets and automatically create the Asset Manager.
            //
            asset1 = new Asset();
            asset2 = new Asset();

            asset3 = new Logger();
            asset4 = new Logger();

            asset5 = new DialogueAsset();

            bridge2.Prefix = "private bridge: ";

            // For Unity3D we need a bridge as Console.WriteLine is not supported and we have to use Debug.log() instead!
            asset3.Bridge = bridge2;

            asset3.log("Asset1: " + asset1.Class + ", " + asset1.Id);
            asset3.log("Asset2: " + asset2.Class + ", " + asset2.Id);
            asset3.log("Asset3: " + asset3.Class + ", " + asset3.Id);
            asset3.log("Asset4: " + asset4.Class + ", " + asset4.Id);
            asset3.log("Asset5: " + asset5.Class + ", " + asset5.Id);
        }
开发者ID:imartinezortiz,项目名称:asset-proof-of-concept-demo_CSharp,代码行数:28,代码来源:Program.cs


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