forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Logging APIs (diff combined with John's changes) #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
039f4e2
structured logger formatter prototype
maryamariyan fc8b72d
add ref to Linq + add public apis
maryamariyan 13bfeaa
New APIs for Structured Log Formatting
maryamariyan 7c40da6
Apply review feedback
maryamariyan 62aeceb
nit cleanup
maryamariyan 391d561
- messages can color vars in messages (Compact)
maryamariyan 881c002
TODO
maryamariyan fb74d57
Rename to XConsoleLog...
maryamariyan 0499b0a
FormatterNames const not instance properties
maryamariyan 805d6e2
add AddCompact and other helpers
maryamariyan 36b7a24
Rename AddCompactFormatter for short?
maryamariyan d9b0c00
Revert "Rename AddCompactFormatter for short?"
maryamariyan 615f88a
Add back deprecated APIs
maryamariyan a84860f
exception messaging in compact remains single line
maryamariyan d3cfd55
cleanup
maryamariyan 8baee3d
rename default to colored
maryamariyan baa7958
deprecate ConsoleLoggerFormat
maryamariyan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rename to XConsoleLog...
- Loading branch information
commit fb74d57d9d15355495bf3af5cea1e4b26c9509e8
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,8 @@ public static partial class ConsoleLoggerExtensions | |
| { | ||
| public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder) { throw null; } | ||
| public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action<Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions> configure) { throw null; } | ||
| public static Microsoft.Extensions.Logging.ILoggingBuilder AddLogFormatter<TFormatter, TOptions>(this Microsoft.Extensions.Logging.ILoggingBuilder builder) where TFormatter : class, Microsoft.Extensions.Logging.Console.ILogFormatter where TOptions : class { throw null; } | ||
| public static Microsoft.Extensions.Logging.ILoggingBuilder AddLogFormatter<TFormatter, TOptions>(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action<TOptions> configure) where TFormatter : class, Microsoft.Extensions.Logging.Console.ILogFormatter where TOptions : class { throw null; } | ||
| public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleLogFormatter<TFormatter, TOptions>(this Microsoft.Extensions.Logging.ILoggingBuilder builder) where TFormatter : class, Microsoft.Extensions.Logging.Console.IConsoleLogFormatter where TOptions : class { throw null; } | ||
| public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleLogFormatter<TFormatter, TOptions>(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action<TOptions> configure) where TFormatter : class, Microsoft.Extensions.Logging.Console.IConsoleLogFormatter where TOptions : class { throw null; } | ||
| } | ||
| } | ||
| namespace Microsoft.Extensions.Logging.Console | ||
|
|
@@ -40,7 +40,7 @@ public ConsoleLoggerOptions() { } | |
| [Microsoft.Extensions.Logging.ProviderAliasAttribute("Console")] | ||
| public partial class ConsoleLoggerProvider : Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.ISupportExternalScope, System.IDisposable | ||
| { | ||
| public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions> options, System.Collections.Generic.IEnumerable<Microsoft.Extensions.Logging.Console.ILogFormatter> formatters) { } | ||
| public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions> options, System.Collections.Generic.IEnumerable<Microsoft.Extensions.Logging.Console.IConsoleLogFormatter> formatters) { } | ||
| public Microsoft.Extensions.Logging.ILogger CreateLogger(string name) { throw null; } | ||
| public void Dispose() { } | ||
| public void SetScopeProvider(Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { } | ||
|
|
@@ -52,48 +52,42 @@ public readonly partial struct ConsoleMessage | |
| public readonly System.ConsoleColor? Foreground; | ||
| public ConsoleMessage(string message, System.ConsoleColor? background = default(System.ConsoleColor?), System.ConsoleColor? foreground = default(System.ConsoleColor?)) { throw null; } | ||
| } | ||
| public partial class DefaultLogFormatter : Microsoft.Extensions.Logging.Console.ILogFormatter, System.IDisposable | ||
| public partial class DefaultConsoleLogFormatter : Microsoft.Extensions.Logging.Console.IConsoleLogFormatter, System.IDisposable | ||
| { | ||
| public DefaultLogFormatter(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.DefaultLogFormatterOptions> options) { } | ||
| public Microsoft.Extensions.Logging.Console.DefaultLogFormatterOptions FormatterOptions { get { throw null; } set { } } | ||
| public DefaultConsoleLogFormatter(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.DefaultConsoleLogFormatterOptions> options) { } | ||
| public Microsoft.Extensions.Logging.Console.DefaultConsoleLogFormatterOptions FormatterOptions { get { throw null; } set { } } | ||
| public string Name { get { throw null; } } | ||
| public void Dispose() { } | ||
| public Microsoft.Extensions.Logging.Console.LogMessageEntry Format(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, string message, System.Exception exception, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { throw null; } | ||
| public Microsoft.Extensions.Logging.Console.LogMessageEntry Format<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, TState state, System.Exception exception, System.Func<TState, System.Exception, string> formatter, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { throw null; } | ||
| } | ||
| public partial class DefaultLogFormatterOptions | ||
| public partial class DefaultConsoleLogFormatterOptions | ||
| { | ||
| public DefaultLogFormatterOptions() { } | ||
| public DefaultConsoleLogFormatterOptions() { } | ||
| public bool DisableColors { get { throw null; } set { } } | ||
| public bool IncludeScopes { get { throw null; } set { } } | ||
| public Microsoft.Extensions.Logging.LogLevel LogToStandardErrorThreshold { get { throw null; } set { } } | ||
| public string TimestampFormat { get { throw null; } set { } } | ||
| public bool UseUtcTimestamp { get { throw null; } set { } } | ||
| } | ||
| public partial interface IConsole | ||
| { | ||
| void Flush(); | ||
| void Write(string message, System.ConsoleColor? background, System.ConsoleColor? foreground); | ||
| void WriteLine(string message, System.ConsoleColor? background, System.ConsoleColor? foreground); | ||
| } | ||
| public partial interface ILogFormatter | ||
| public partial interface IConsoleLogFormatter | ||
| { | ||
| string Name { get; } | ||
| Microsoft.Extensions.Logging.Console.LogMessageEntry Format(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, string message, System.Exception exception, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider); | ||
| Microsoft.Extensions.Logging.Console.LogMessageEntry Format<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, TState state, System.Exception exception, System.Func<TState, System.Exception, string> formatter, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we simplify the ctor and move ScopeProvider into the service container? |
||
| } | ||
| public partial class JsonConsoleLogFormatter : Microsoft.Extensions.Logging.Console.ILogFormatter, System.IDisposable | ||
| public partial class JsonConsoleLogFormatter : Microsoft.Extensions.Logging.Console.IConsoleLogFormatter, System.IDisposable | ||
| { | ||
| public JsonConsoleLogFormatter(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.JsonLogFormatterOptions> options) { } | ||
| public Microsoft.Extensions.Logging.Console.JsonLogFormatterOptions FormatterOptions { get { throw null; } set { } } | ||
| public JsonConsoleLogFormatter(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.JsonConsoleLogFormatterOptions> options) { } | ||
| public Microsoft.Extensions.Logging.Console.JsonConsoleLogFormatterOptions FormatterOptions { get { throw null; } set { } } | ||
| public string Name { get { throw null; } } | ||
| public void Dispose() { } | ||
| public Microsoft.Extensions.Logging.Console.LogMessageEntry Format(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, string message, System.Exception exception, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { throw null; } | ||
| public Microsoft.Extensions.Logging.Console.LogMessageEntry Format<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, TState state, System.Exception exception, System.Func<TState, System.Exception, string> formatter, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { throw null; } | ||
| } | ||
| public partial class JsonLogFormatterOptions | ||
| public partial class JsonConsoleLogFormatterOptions | ||
| { | ||
| public JsonLogFormatterOptions() { } | ||
| public JsonConsoleLogFormatterOptions() { } | ||
| public bool IncludeScopes { get { throw null; } set { } } | ||
| public System.Text.Json.JsonSerializerOptions JsonSerializerOptions { get { throw null; } set { } } | ||
| public System.Text.Json.JsonWriterOptions JsonWriterOptions { get { throw null; } set { } } | ||
|
|
@@ -107,18 +101,18 @@ public readonly partial struct LogMessageEntry | |
| public readonly Microsoft.Extensions.Logging.Console.ConsoleMessage[] Messages; | ||
| public LogMessageEntry(Microsoft.Extensions.Logging.Console.ConsoleMessage[] messages, bool logAsError = false) { throw null; } | ||
| } | ||
| public partial class SystemdLogFormatter : Microsoft.Extensions.Logging.Console.ILogFormatter, System.IDisposable | ||
| public partial class SystemdConsoleLogFormatter : Microsoft.Extensions.Logging.Console.IConsoleLogFormatter, System.IDisposable | ||
| { | ||
| public SystemdLogFormatter(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.SystemdLogFormatterOptions> options) { } | ||
| public Microsoft.Extensions.Logging.Console.SystemdLogFormatterOptions FormatterOptions { get { throw null; } set { } } | ||
| public SystemdConsoleLogFormatter(Microsoft.Extensions.Options.IOptionsMonitor<Microsoft.Extensions.Logging.Console.SystemdConsoleLogFormatterOptions> options) { } | ||
| public Microsoft.Extensions.Logging.Console.SystemdConsoleLogFormatterOptions FormatterOptions { get { throw null; } set { } } | ||
| public string Name { get { throw null; } } | ||
| public void Dispose() { } | ||
| public Microsoft.Extensions.Logging.Console.LogMessageEntry Format(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, string message, System.Exception exception, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { throw null; } | ||
| public Microsoft.Extensions.Logging.Console.LogMessageEntry Format<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, string logName, int eventId, TState state, System.Exception exception, System.Func<TState, System.Exception, string> formatter, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { throw null; } | ||
| } | ||
| public partial class SystemdLogFormatterOptions | ||
| public partial class SystemdConsoleLogFormatterOptions | ||
| { | ||
| public SystemdLogFormatterOptions() { } | ||
| public SystemdConsoleLogFormatterOptions() { } | ||
| public bool IncludeScopes { get { throw null; } set { } } | ||
| public Microsoft.Extensions.Logging.LogLevel LogToStandardErrorThreshold { get { throw null; } set { } } | ||
| public string TimestampFormat { get { throw null; } set { } } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.