// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Net.Http; namespace System.Web.Http.Tracing { /// /// Interface to write instances. /// public interface ITraceWriter { /// /// Creates and writes a new to the current /// if tracing is enabled for the given and . /// /// /// The decision whether tracing is enabled for a specific category and level /// is an implementation detail of each individual . /// /// If the current decides tracing is enabled for the given /// category and level, it will construct a new and invoke /// the caller's to allow the caller to fill in additional /// information. /// /// /// If the current decides tracing is not enabled for the given /// category and level, no will be created, /// and the will not be called. /// /// /// The with which to associate /// the . It may be null but doing so will result in /// a that is not correlated with its originating request. /// The logical category for the trace. Users may define their own. /// The at which to write this trace. /// The action to invoke if tracing is enabled. The caller is expected /// to fill in any or all of the values of the given in this action. void Trace(HttpRequestMessage request, string category, TraceLevel level, Action traceAction); } }