public class TextWriterLogger : object, ILogger
Logger that logs to an arbitrary System.IO.TextWriter
.
Implements
ILoggerDerived Types
Namespace
Grpc.Core.LoggingAssembly
Grpc.Core.dll
Constructors
TextWriterLogger(Func<TextWriter>)
public TextWriterLogger(Func<TextWriter> textWriterProvider)
Creates a console logger not associated to any specific type and writes to a System.IO.TextWriter
obtained from given provider.
User is responsible for providing an instance of TextWriter that is thread-safe.
Type | Name | Description |
---|---|---|
Func<TextWriter> | textWriterProvider |
TextWriterLogger(Func<TextWriter>, Type)
protected TextWriterLogger(Func<TextWriter> textWriterProvider, Type forType)
Creates a console logger that logs messsage specific for given type.
Type | Name | Description |
---|---|---|
Func<TextWriter> | textWriterProvider | |
Type | forType |
TextWriterLogger(TextWriter)
public TextWriterLogger(TextWriter textWriter)
Creates a console logger not associated to any specific type and writes to given System.IO.TextWriter
.
User is responsible for providing an instance of TextWriter that is thread-safe.
Type | Name | Description |
---|---|---|
TextWriter | textWriter |
Properties
AssociatedType
protected Type AssociatedType { get; }
Gets the type associated with this logger.
Type | Description |
---|---|
Type |
Methods
Debug(String)
public void Debug(string message)
Logs a message with severity Debug.
Type | Name | Description |
---|---|---|
String | message |
Debug(String, Object[])
public void Debug(string format, params object[] formatArgs)
Logs a formatted message with severity Debug.
Type | Name | Description |
---|---|---|
String | format | |
Object[] | formatArgs |
Error(Exception, String)
public void Error(Exception exception, string message)
Logs a message and an associated exception with severity Error.
Type | Name | Description |
---|---|---|
Exception | exception | |
String | message |
Error(String)
public void Error(string message)
Logs a message with severity Error.
Type | Name | Description |
---|---|---|
String | message |
Error(String, Object[])
public void Error(string format, params object[] formatArgs)
Logs a formatted message with severity Error.
Type | Name | Description |
---|---|---|
String | format | |
Object[] | formatArgs |
ForType<T>()
public virtual ILogger ForType<T>()
Returns a logger associated with the specified type.
Type | Description |
---|---|
ILogger |
Name | Description |
---|---|
T |
Info(String)
public void Info(string message)
Logs a message with severity Info.
Type | Name | Description |
---|---|---|
String | message |
Info(String, Object[])
public void Info(string format, params object[] formatArgs)
Logs a formatted message with severity Info.
Type | Name | Description |
---|---|---|
String | format | |
Object[] | formatArgs |
Warning(Exception, String)
public void Warning(Exception exception, string message)
Logs a message and an associated exception with severity Warning.
Type | Name | Description |
---|---|---|
Exception | exception | |
String | message |
Warning(String)
public void Warning(string message)
Logs a message with severity Warning.
Type | Name | Description |
---|---|---|
String | message |
Warning(String, Object[])
public void Warning(string format, params object[] formatArgs)
Logs a formatted message with severity Warning.
Type | Name | Description |
---|---|---|
String | format | |
Object[] | formatArgs |