1 #region Copyright notice and license 2 3 // Copyright 2015 gRPC authors. 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 17 #endregion 18 19 using System; 20 using System.Collections.Generic; 21 22 namespace Grpc.Core.Logging 23 { 24 /// <summary>For logging messages.</summary> 25 public interface ILogger 26 { 27 /// <summary>Returns a logger associated with the specified type.</summary> ForType()28 ILogger ForType<T>(); 29 30 /// <summary>Logs a message with severity Debug.</summary> Debug(string message)31 void Debug(string message); 32 33 /// <summary>Logs a formatted message with severity Debug.</summary> Debug(string format, params object[] formatArgs)34 void Debug(string format, params object[] formatArgs); 35 36 /// <summary>Logs a message with severity Info.</summary> Info(string message)37 void Info(string message); 38 39 /// <summary>Logs a formatted message with severity Info.</summary> Info(string format, params object[] formatArgs)40 void Info(string format, params object[] formatArgs); 41 42 /// <summary>Logs a message with severity Warning.</summary> Warning(string message)43 void Warning(string message); 44 45 /// <summary>Logs a formatted message with severity Warning.</summary> Warning(string format, params object[] formatArgs)46 void Warning(string format, params object[] formatArgs); 47 48 /// <summary>Logs a message and an associated exception with severity Warning.</summary> Warning(Exception exception, string message)49 void Warning(Exception exception, string message); 50 51 /// <summary>Logs a message with severity Error.</summary> Error(string message)52 void Error(string message); 53 54 /// <summary>Logs a formatted message with severity Error.</summary> Error(string format, params object[] formatArgs)55 void Error(string format, params object[] formatArgs); 56 57 /// <summary>Logs a message and an associated exception with severity Error.</summary> Error(Exception exception, string message)58 void Error(Exception exception, string message); 59 } 60 } 61