Index: third_party/grpc/src/csharp/Grpc.Core/Logging/ILogger.cs |
diff --git a/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs b/third_party/grpc/src/csharp/Grpc.Core/Logging/ILogger.cs |
similarity index 50% |
copy from third_party/protobuf/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs |
copy to third_party/grpc/src/csharp/Grpc.Core/Logging/ILogger.cs |
index f5570fc40a24f9e91017280b4f6389607be6e1a7..7c0326422f4cfeffde6dc15fe3c7bc136cc729fc 100644 |
--- a/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/DescriptorUtil.cs |
+++ b/third_party/grpc/src/csharp/Grpc.Core/Logging/ILogger.cs |
@@ -1,7 +1,7 @@ |
#region Copyright notice and license |
-// Protocol Buffers - Google's data interchange format |
-// Copyright 2008 Google Inc. All rights reserved. |
-// https://developers.google.com/protocol-buffers/ |
+ |
+// Copyright 2015, Google Inc. |
+// All rights reserved. |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,37 +28,48 @@ |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+ |
#endregion |
+using System; |
using System.Collections.Generic; |
-using System.Collections.ObjectModel; |
-namespace Google.Protobuf.Reflection |
+namespace Grpc.Core.Logging |
{ |
- /// <summary> |
- /// Internal class containing utility methods when working with descriptors. |
- /// </summary> |
- internal static class DescriptorUtil |
+ /// <summary>For logging messages.</summary> |
+ public interface ILogger |
{ |
- /// <summary> |
- /// Equivalent to Func[TInput, int, TOutput] but usable in .NET 2.0. Only used to convert |
- /// arrays. |
- /// </summary> |
- internal delegate TOutput IndexedConverter<TInput, TOutput>(TInput element, int index); |
+ /// <summary>Returns a logger associated with the specified type.</summary> |
+ ILogger ForType<T>(); |
+ |
+ /// <summary>Logs a message with severity Debug.</summary> |
+ void Debug(string message); |
+ |
+ /// <summary>Logs a formatted message with severity Debug.</summary> |
+ void Debug(string format, params object[] formatArgs); |
+ |
+ /// <summary>Logs a message with severity Info.</summary> |
+ void Info(string message); |
+ |
+ /// <summary>Logs a formatted message with severity Info.</summary> |
+ void Info(string format, params object[] formatArgs); |
+ |
+ /// <summary>Logs a message with severity Warning.</summary> |
+ void Warning(string message); |
+ |
+ /// <summary>Logs a formatted message with severity Warning.</summary> |
+ void Warning(string format, params object[] formatArgs); |
+ |
+ /// <summary>Logs a message and an associated exception with severity Warning.</summary> |
+ void Warning(Exception exception, string message); |
+ |
+ /// <summary>Logs a message with severity Error.</summary> |
+ void Error(string message); |
+ |
+ /// <summary>Logs a formatted message with severity Error.</summary> |
+ void Error(string format, params object[] formatArgs); |
- /// <summary> |
- /// Converts the given array into a read-only list, applying the specified conversion to |
- /// each input element. |
- /// </summary> |
- internal static IList<TOutput> ConvertAndMakeReadOnly<TInput, TOutput> |
- (IList<TInput> input, IndexedConverter<TInput, TOutput> converter) |
- { |
- TOutput[] array = new TOutput[input.Count]; |
- for (int i = 0; i < array.Length; i++) |
- { |
- array[i] = converter(input[i], i); |
- } |
- return new ReadOnlyCollection<TOutput>(array); |
- } |
+ /// <summary>Logs a message and an associated exception with severity Error.</summary> |
+ void Error(Exception exception, string message); |
} |
-} |
+} |