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


C# Logger.Info方法代碼示例

本文整理匯總了C#中Orleans.Runtime.Logger.Info方法的典型用法代碼示例。如果您正苦於以下問題:C# Logger.Info方法的具體用法?C# Logger.Info怎麽用?C# Logger.Info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Orleans.Runtime.Logger的用法示例。


在下文中一共展示了Logger.Info方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnActivateAsync

        public override async Task OnActivateAsync()
        {
            logger = base.GetLogger("MultipleImplicitSubscriptionGrain " + base.IdentityString);
            logger.Info("OnActivateAsync");

            var streamProvider = GetStreamProvider("SMSProvider");
            redStream = streamProvider.GetStream<int>(this.GetPrimaryKey(), "red");
            blueStream = streamProvider.GetStream<int>(this.GetPrimaryKey(), "blue");

            await redStream.SubscribeAsync(
                (e, t) =>
                {
                    logger.Info("Received a red event {0}", e);
                    redCounter++;
                    return TaskDone.Done;
                });

            await blueStream.SubscribeAsync(
                (e, t) =>
                {
                    logger.Info("Received a blue event {0}", e);
                    blueCounter++;
                    return TaskDone.Done;
                });
        }
開發者ID:naeemkhedarun,項目名稱:orleans,代碼行數:25,代碼來源:MultipleImplicitSubscriptionGrain.cs

示例2: Initialize_2

 public Task Initialize_2(int ind)
 {
     index = ind;
     logger = GetLogger("ConcurrentGrain-" + index);
     logger.Info("Initialize(" + index + ")");
     return TaskDone.Done;
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:7,代碼來源:ConcurrentGrain.cs

示例3: OnActivateAsync

 public override Task OnActivateAsync()
 {
     logger = base.GetLogger("StreamerOutGrain " + base.IdentityString);
     logger.Info("OnActivateAsync");
     numProducedItems = 0;
     return TaskDone.Done;
 }
開發者ID:OrleansContrib,項目名稱:Orleans.StorageProviders.SimpleSQLServerStorage,代碼行數:7,代碼來源:StreamerOutGrain.cs

示例4: OnActivateAsync

 public override Task OnActivateAsync()
 {
     Logger = GetLogger("BatchProducerGrain " + IdentityString);
     Logger.Info("OnActivateAsync");
     _numProducedItems = 0;
     return TaskDone.Done;            
 }
開發者ID:gigya,項目名稱:Orleans.KafkaStreamProvider,代碼行數:7,代碼來源:BatchProducerGrain.cs

示例5: AzureGossipTableTests

        private AzureTableBasedGossipChannel gossipTable; // This type is internal

        public AzureGossipTableTests()
        {
            logger = LogManager.GetLogger("AzureGossipTableTests", LoggerType.Application);
        
            globalServiceId = Guid.NewGuid();
            deploymentId = "test-" + globalServiceId;

            IPAddress ip;
            if (!IPAddress.TryParse("127.0.0.1", out ip))
            {
                logger.Error(-1, "Could not parse ip address");
                return;
            }
            IPEndPoint ep1 = new IPEndPoint(ip, 21111);
            siloAddress1 = SiloAddress.New(ep1, 0);
            IPEndPoint ep2 = new IPEndPoint(ip, 21112);
            siloAddress2 = SiloAddress.New(ep2, 0);

            logger.Info("DeploymentId={0}", deploymentId);

            GlobalConfiguration config = new GlobalConfiguration
            {
                ServiceId = globalServiceId,
                ClusterId = "0",
                DeploymentId = deploymentId,
                DataConnectionString = TestDefaultConfiguration.DataConnectionString
            };

            gossipTable = new AzureTableBasedGossipChannel();
            var done = gossipTable.Initialize(config.ServiceId, config.DataConnectionString);
            if (!done.Wait(timeout))
            {
                throw new TimeoutException("Could not create/read table.");
            }
        }
開發者ID:jdom,項目名稱:orleans,代碼行數:37,代碼來源:AzureGossipTableTests.cs

示例6: OnActivateAsync

 public override Task OnActivateAsync()
 {
     activationGuid = Guid.NewGuid();
     logger = GetLogger(String.Format("{0}", activationGuid));
     logger.Info("Activate.");
     return TaskDone.Done;
 }
開發者ID:naeemkhedarun,項目名稱:orleans,代碼行數:7,代碼來源:StatelessWorkerGrain.cs

示例7: Init

        /// <summary>
        /// Initialize current instance with specific global configuration and logger
        /// </summary>
        /// <param name="config"> Global configuration to initialize with </param>
        /// <param name="logger"> Specific logger to use in current instance </param>
        /// <returns></returns>
        public Task Init(GlobalConfiguration config, Logger logger)
        {
            deploymentId = config.DeploymentId;
            serviceId = config.ServiceId;

            this.logger = logger;

            storage = new DynamoDBStorage(config.DataConnectionStringForReminders, logger);
            logger.Info(ErrorCode.ReminderServiceBase, "Initializing AWS DynamoDB Reminders Table");

            var secondaryIndex = new GlobalSecondaryIndex
            {
                IndexName = SERVICE_ID_INDEX,
                Projection = new Projection { ProjectionType = ProjectionType.ALL },
                KeySchema = new List<KeySchemaElement>
                {
                    new KeySchemaElement { AttributeName = SERVICE_ID_PROPERTY_NAME, KeyType = KeyType.HASH},
                    new KeySchemaElement { AttributeName = GRAIN_HASH_PROPERTY_NAME, KeyType = KeyType.RANGE }
                }
            };

            return storage.InitializeTable(TABLE_NAME_DEFAULT_VALUE,
                new List<KeySchemaElement>
                {
                    new KeySchemaElement { AttributeName = REMINDER_ID_PROPERTY_NAME, KeyType = KeyType.HASH },
                    new KeySchemaElement { AttributeName = GRAIN_HASH_PROPERTY_NAME, KeyType = KeyType.RANGE }
                },
                new List<AttributeDefinition>
                {
                    new AttributeDefinition { AttributeName = REMINDER_ID_PROPERTY_NAME, AttributeType = ScalarAttributeType.S },
                    new AttributeDefinition { AttributeName = GRAIN_HASH_PROPERTY_NAME, AttributeType = ScalarAttributeType.N },
                    new AttributeDefinition { AttributeName = SERVICE_ID_PROPERTY_NAME, AttributeType = ScalarAttributeType.S }
                },
                new List<GlobalSecondaryIndex> { secondaryIndex });
        }
開發者ID:osjimenez,項目名稱:orleans,代碼行數:41,代碼來源:DynamoDBReminderTable.cs

示例8: PersistentStreamPullingAgent

        internal PersistentStreamPullingAgent(
            GrainId id, 
            string strProviderName,
            IStreamProviderRuntime runtime,
            IStreamPubSub streamPubSub,
            QueueId queueId,
            PersistentStreamProviderConfig config)
            : base(id, runtime.ExecutingSiloAddress, true)
        {
            if (runtime == null) throw new ArgumentNullException("runtime", "PersistentStreamPullingAgent: runtime reference should not be null");
            if (strProviderName == null) throw new ArgumentNullException("runtime", "PersistentStreamPullingAgent: strProviderName should not be null");

            QueueId = queueId;
            streamProviderName = strProviderName;
            providerRuntime = runtime;
            pubSub = streamPubSub;
            pubSubCache = new Dictionary<StreamId, StreamConsumerCollection>();
            safeRandom = new SafeRandom();
            this.config = config;
            numMessages = 0;

            logger = providerRuntime.GetLogger(GrainId + "-" + streamProviderName);
            logger.Info((int)ErrorCode.PersistentStreamPullingAgent_01, 
                "Created {0} {1} for Stream Provider {2} on silo {3} for Queue {4}.",
                GetType().Name, GrainId.ToDetailedString(), streamProviderName, Silo, QueueId.ToStringWithHashCode());

            string statUniquePostfix = strProviderName + "." + QueueId;
            numReadMessagesCounter = CounterStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_NUM_READ_MESSAGES, statUniquePostfix));
            numSentMessagesCounter = CounterStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_NUM_SENT_MESSAGES, statUniquePostfix));
            IntValueStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_PUBSUB_CACHE_SIZE, statUniquePostfix), () => pubSubCache.Count);
            // TODO: move queue cache size statistics tracking into queue cache implementation once Telemetry APIs and LogStatistics have been reconciled.
            //IntValueStatistic.FindOrCreate(new StatisticName(StatisticNames.STREAMS_PERSISTENT_STREAM_QUEUE_CACHE_SIZE, statUniquePostfix), () => queueCache != null ? queueCache.Size : 0);
        }
開發者ID:NingnaD,項目名稱:orleans,代碼行數:33,代碼來源:PersistentStreamPullingAgent.cs

示例9: OnActivateAsync

 public override async Task OnActivateAsync()
 {
     await base.OnActivateAsync();
     string id = this.GetPrimaryKeyLong().ToString();
     logger = GetLogger(String.Format("{0}-{1}", GetType().Name, id));
     logger.Info("Activate.");
 }
開發者ID:osjimenez,項目名稱:orleans,代碼行數:7,代碼來源:ClusterTestGrains.cs

示例10: OnDeactivateAsync

 public override async Task OnDeactivateAsync()
 {
     _logger = GetLogger("ProducerEventCountingGrain " + IdentityString);
     _logger.Info("Producer.OnDeactivateAsync");
     _numProducedItems = 0;
     await base.OnDeactivateAsync();
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:7,代碼來源:ProducerEventCountingGrain.cs

示例11: OnActivateAsync

        public override Task OnActivateAsync()
        {
            logger = base.GetLogger("GeneratedEventReporterGrain " + base.IdentityString);
            logger.Info("OnActivateAsync");

            reports = new Dictionary<Tuple<string, string>, Dictionary<Guid, int>>();
            return base.OnActivateAsync();
        }
開發者ID:Johnny-Bee,項目名稱:orleans,代碼行數:8,代碼來源:GeneratedEventReporterGrain.cs

示例12: OnActivateAsync

 public override Task OnActivateAsync()
 {
     EventDelay = 1000;
     Observers = new ObserverSubscriptionManager<ISimpleGrainObserver>();
     logger = GetLogger(String.Format("{0}-{1}-{2}", typeof(SimpleObserverableGrain).Name, base.IdentityString, base.RuntimeIdentity));
     logger.Info("Activate.");
     return TaskDone.Done;
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:8,代碼來源:SimpleObserverableGrain.cs

示例13: OnActivateAsync

 public override Task OnActivateAsync()
 {
     grainStore = new Dictionary<string, GrainStateStore>();
     base.DelayDeactivation(TimeSpan.FromDays(10 * 365)); // Delay Deactivation for MemoryStorageGrain virtually indefinitely.
     logger = GetLogger(GetType().Name);
     logger.Info("OnActivateAsync");
     return TaskDone.Done;
 }
開發者ID:sbambach,項目名稱:orleans,代碼行數:8,代碼來源:MemoryStorageGrain.cs

示例14: OnActivateAsync

 public override Task OnActivateAsync()
 {
     logger = GetLogger(String.Format("CollectionTestGrain {0} {1} on {2}.", Identity, Data.ActivationId, RuntimeIdentity));
     logger.Info("OnActivateAsync.");
     activated = DateTime.UtcNow;
     counter = 0;
     return TaskDone.Done;
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:8,代碼來源:CollectionTestGrain.cs

示例15: LogStartTest

 internal static void LogStartTest(string testName, Guid streamId, string streamProviderName, Logger logger, TestingSiloHost siloHost)
 {
     SiloAddress primSilo = siloHost.Primary.Silo.SiloAddress;
     SiloAddress secSilo = siloHost.Secondary?.Silo.SiloAddress;
     logger.Info("\n\n**START********************** {0} ********************************* \n\n"
                 + "Running with initial silos Primary={1} Secondary={2} StreamId={3} StreamType={4} \n\n",
         testName, primSilo, secSilo, streamId, streamProviderName);
 }
開發者ID:Rejendo,項目名稱:orleans,代碼行數:8,代碼來源:StreamTestUtils.cs


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