internal static void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, long objectId, long fragmentId, int isStartFragment, int isEndFragment, int fragmentLength, PSETWBinaryBlob fragmentData) { if (provider.IsEnabled(PSLevel.Verbose, keyword)) { string str = BitConverter.ToString(fragmentData.blob, fragmentData.offset, fragmentData.length); str = string.Format(CultureInfo.InvariantCulture, "0x{0}", new object[] { str.Replace("-", "") }); provider.WriteEvent(id, PSChannel.Analytic, opcode, PSLevel.Verbose, task, keyword, new object[] { objectId, fragmentId, isStartFragment, isEndFragment, fragmentLength, str }); } }
/// <summary> /// Logs error message to operation channel. /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal static void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { provider.WriteEvent(id, PSChannel.Operational, opcode, PSLevel.Error, task, keyword, args); }
/// <summary> /// Logs remoting fragment data to verbose channel. /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="objectId"></param> /// <param name="fragmentId"></param> /// <param name="isStartFragment"></param> /// <param name="isEndFragment"></param> /// <param name="fragmentLength"></param> /// <param name="fragmentData"></param> internal static void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, Int64 objectId, Int64 fragmentId, int isStartFragment, int isEndFragment, UInt32 fragmentLength, PSETWBinaryBlob fragmentData) { if (provider.IsEnabled(PSLevel.Verbose, keyword)) { string payLoadData = BitConverter.ToString(fragmentData.blob, fragmentData.offset, fragmentData.length); payLoadData = string.Format(CultureInfo.InvariantCulture, "0x{0}", payLoadData.Replace("-", "")); provider.WriteEvent(id, PSChannel.Analytic, opcode, PSLevel.Verbose, task, keyword, objectId, fragmentId, isStartFragment, isEndFragment, fragmentLength, payLoadData); } }
/// <summary> /// Writes a single event /// </summary> /// <param name="id">event id</param> /// <param name="channel"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="logContext">log context</param> /// <param name="payLoad"></param> internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { WriteEvent(id, channel, opcode, GetPSLevelFromSeverity(logContext.Severity), task, (PSKeyword)0x0, LogContextToString(logContext), GetPSLogUserData(logContext.ExecutionContext), payLoad); }
static internal void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { }
static internal void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSLevel level, PSTask task, PSKeyword keyword, params object[] args) { long keywords = 0L; if ((keyword == PSKeyword.UseAlwaysAnalytic) || (keyword == PSKeyword.UseAlwaysOperational)) { keywords = 0L; } else { keywords = (long) keyword; } System.Diagnostics.Eventing.EventDescriptor eventDescriptor = new System.Diagnostics.Eventing.EventDescriptor((int) id, 1, (byte) channel, (byte) level, (byte) opcode, (int) task, keywords); etwProvider.WriteEvent(ref eventDescriptor, args); }
/// <summary> /// Logs information to the operational channel /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal static void LogOperationalWarning(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { provider.WriteEvent(id, PSChannel.Operational, opcode, PSLevel.Warning, task, keyword, args); }
internal abstract void WriteTransferEvent( Guid relatedActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task);
/// <summary> /// Logs error message to operation channel. /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal static void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
/// <summary> /// Logs informational message to the analytic channel /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal static void LogAnalyticInformational(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
internal static void ReplaceActivityIdForCurrentThread(Guid newActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { provider.SetActivityIdForCurrentThread(newActivityId); WriteTransferEvent(newActivityId, eventForOperationalChannel, eventForAnalyticChannel, keyword, task); }
internal abstract void WriteDebug( PSEventId id, PSOpcode opcode, PSTask task, params object[] args);
internal abstract void WriteInformation( PSEventId id, PSOpcode opcode, PSTask task, params object[] args);
internal static void ReplaceActivityIdForCurrentThread(Guid newActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { // set the new activity id provider.SetActivityIdForCurrentThread(newActivityId); // Once the activity id is set, write the transfer event WriteTransferEvent(newActivityId, eventForOperationalChannel, eventForAnalyticChannel, keyword, task); }
static internal void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
internal abstract void WriteCritialError( PSEventId id, PSOpcode opcode, PSTask task, params object[] args);
static internal void ReplaceActivityIdForCurrentThread(Guid newActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { }
/// <summary> /// Logs verbose message to the analytic channel /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal static void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { provider.WriteEvent(id, PSChannel.Analytic, opcode, PSLevel.Verbose, task, keyword, args); }
static internal void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { }
static internal void LogAnalyticVerbose(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, Int64 objectId, Int64 fragmentId, int isStartFragment, int isEndFragment, UInt32 fragmentLength, PSETWBinaryBlob fragmentData) { }
static internal void LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
static internal void ReplaceActivityIdForCurrentThread(Guid newActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { }
/// <summary> /// Writes an event. /// </summary> /// <param name="id"></param> /// <param name="channel"></param> /// <param name="opcode"></param> /// <param name="level"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSLevel level, PSTask task, PSKeyword keyword, params object[] args) { s_provider.Log(id, channel, task, opcode, level, keyword, args); }
static internal void LogOperationalInformation(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { }
/// <summary> /// Writes a single event. /// </summary> /// <param name="id">Event id.</param> /// <param name="channel"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="logContext">Log context.</param> /// <param name="payLoad"></param> internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { WriteEvent(id, channel, opcode, GetPSLevelFromSeverity(logContext.Severity), task, (PSKeyword)0x0, LogContextToString(logContext), GetPSLogUserData(logContext.ExecutionContext), payLoad); }
/// <summary> /// Writes an event /// </summary> /// <param name="id"></param> /// <param name="channel"></param> /// <param name="opcode"></param> /// <param name="level"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal void WriteEvent(PSEventId id, PSChannel channel, PSOpcode opcode, PSLevel level, PSTask task, PSKeyword keyword, params object[] args) { long longKeyword = 0x00; if (keyword == PSKeyword.UseAlwaysAnalytic || keyword == PSKeyword.UseAlwaysOperational) { longKeyword = 0x00; } else { longKeyword = (long)keyword; } EventDescriptor desc = new EventDescriptor((int)id, (byte)PSEventVersion.One, (byte)channel, (byte)level, (byte)opcode, (int)task, longKeyword); etwProvider.WriteEvent(ref desc, args); }
/// <summary> /// Log an error message. /// </summary> private static void LogError(PSEventId eventId, params object[] args) { PSEtwLog.LogOperationalError(eventId, PSOpcode.Constructor, PSTask.ExperimentalFeature, PSKeyword.UseAlwaysOperational, args); }
/// <summary> /// Logs informational message to the analytic channel /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="keyword"></param> /// <param name="args"></param> internal static void LogAnalyticInformational(PSEventId id, PSOpcode opcode, PSTask task, PSKeyword keyword, params object[] args) { provider.WriteEvent(id, PSChannel.Analytic, opcode, PSLevel.Informational, task, keyword, args); }
/// <summary> /// Logs error message to the operational channel /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="logContext"></param> /// <param name="payLoad"></param> internal static void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { provider.WriteEvent(id, PSChannel.Operational, opcode, task, logContext, payLoad); }
/// <summary> /// Logs error message to the operational channel /// </summary> /// <param name="id"></param> /// <param name="opcode"></param> /// <param name="task"></param> /// <param name="logContext"></param> /// <param name="payLoad"></param> internal static void LogOperationalError(PSEventId id, PSOpcode opcode, PSTask task, LogContext logContext, string payLoad) { provider.WriteEvent(id, PSChannel.Operational, opcode, task, logContext, payLoad); }
internal static void ReplaceActivityIdForCurrentThread(Guid newActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { // set the new activity id provider.SetActivityIdForCurrentThread(newActivityId); // Once the activity id is set, write the transfer event WriteTransferEvent(newActivityId, eventForOperationalChannel, eventForAnalyticChannel, keyword, task); }
/// <summary> /// Writes a transfer event mapping current activity id /// with a related activity id /// This function writes a transfer event for both the /// operational and analytic channels /// </summary> /// <param name="relatedActivityId"></param> /// <param name="eventForOperationalChannel"></param> /// <param name="eventForAnalyticChannel"></param> /// <param name="keyword"></param> /// <param name="task"></param> internal static void WriteTransferEvent(Guid relatedActivityId, PSEventId eventForOperationalChannel, PSEventId eventForAnalyticChannel, PSKeyword keyword, PSTask task) { provider.WriteEvent(eventForOperationalChannel, PSChannel.Operational, PSOpcode.Method, PSLevel.Informational, task, PSKeyword.UseAlwaysOperational); provider.WriteEvent(eventForAnalyticChannel, PSChannel.Analytic, PSOpcode.Method, PSLevel.Informational, task, PSKeyword.UseAlwaysAnalytic); }
internal abstract void WriteEvent( PSEventId id, PSLevel level, PSOpcode opcode, PSTask task, params object[] args);