Пример #1
0
        /// <inheritdoc />
        public virtual void FieldResolutionStarted(FieldResolutionContext context)
        {
            if (!this.IsEnabled(LogLevel.Trace))
            {
                return;
            }

            var entry = new FieldResolutionStartedLogEntry(context);

            this.LogEvent(LogLevel.Trace, entry);
        }
Пример #2
0
        public void FieldResolutionStartedLogEntry()
        {
            var server = new TestServerBuilder()
                         .AddGraphType <LogTestController>()
                         .Build();

            var package           = server.CreateFieldContextBuilder <LogTestController>(nameof(LogTestController.ExecuteField2));
            var resolutionContext = package.CreateResolutionContext();

            var entry = new FieldResolutionStartedLogEntry(resolutionContext);

            Assert.AreEqual(LogEventIds.FieldResolutionStarted.Id, entry.EventId);
            Assert.AreEqual(resolutionContext.Request.Id, entry.PipelineRequestId);
            Assert.AreEqual(resolutionContext.Request.Field.Mode.ToString(), entry.FieldExecutionMode);
            Assert.AreEqual(resolutionContext.Request.Field.Route.Path, entry.FieldPath);
            Assert.IsNotNull(entry.ToString());
        }