Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ILogger.Extensions.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 //
4 // File AUTO-GENERATED, do not edit!
5 using System;
6 
7 namespace SiliconStudio.Core.Diagnostics
8 {
9  /// <summary>
10  /// Extensions for <see cref="ILogger"/>.
11  /// </summary>
12  public static partial class LoggerExtensions
13  {
14  /// <summary>
15  /// Logs the specified verbose message with an exception.
16  /// </summary>
17  /// <param name="message">The verbose message.</param>
18  /// <param name="exception">An exception to log with the message.</param>
19  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
20  public static void Verbose(this ILogger log, string message, Exception exception, CallerInfo callerInfo = null)
21  {
22  log.Log(new LogMessage(log.Module, LogMessageType.Verbose, message, exception, callerInfo));
23  }
24 
25  /// <summary>
26  /// Logs the specified verbose message.
27  /// </summary>
28  /// <param name="message">The verbose message.</param>
29  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
30  public static void Verbose(this ILogger log, string message, CallerInfo callerInfo = null)
31  {
32  Verbose(log, message, null, callerInfo);
33  }
34 
35  /// <summary>
36  /// Logs the specified verbose message.
37  /// </summary>
38  /// <param name="messageFormat">The verbose message to format.</param>
39  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
40  public static void Verbose(this ILogger log, string messageFormat, params object[] parameters)
41  {
42  Verbose(log, messageFormat, null, parameters);
43  }
44 
45  /// <summary>
46  /// Logs the specified verbose message with an exception.
47  /// </summary>
48  /// <param name="messageFormat">The verbose message to format.</param>
49  /// <param name="exception">An exception to log with the message.</param>
50  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
51  /// <exception cref="System.ArgumentNullException"></exception>
52  public static void Verbose(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
53  {
54  if (parameters == null) throw new ArgumentNullException("parameters");
55  Verbose(log, string.Format(messageFormat, parameters), exception, Logger.ExtractCallerInfo(parameters));
56  }
57  /// <summary>
58  /// Logs the specified debug message with an exception.
59  /// </summary>
60  /// <param name="message">The debug message.</param>
61  /// <param name="exception">An exception to log with the message.</param>
62  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
63  public static void Debug(this ILogger log, string message, Exception exception, CallerInfo callerInfo = null)
64  {
65  log.Log(new LogMessage(log.Module, LogMessageType.Debug, message, exception, callerInfo));
66  }
67 
68  /// <summary>
69  /// Logs the specified debug message.
70  /// </summary>
71  /// <param name="message">The debug message.</param>
72  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
73  public static void Debug(this ILogger log, string message, CallerInfo callerInfo = null)
74  {
75  Debug(log, message, null, callerInfo);
76  }
77 
78  /// <summary>
79  /// Logs the specified debug message.
80  /// </summary>
81  /// <param name="messageFormat">The debug message to format.</param>
82  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
83  public static void Debug(this ILogger log, string messageFormat, params object[] parameters)
84  {
85  Debug(log, messageFormat, null, parameters);
86  }
87 
88  /// <summary>
89  /// Logs the specified debug message with an exception.
90  /// </summary>
91  /// <param name="messageFormat">The debug message to format.</param>
92  /// <param name="exception">An exception to log with the message.</param>
93  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
94  /// <exception cref="System.ArgumentNullException"></exception>
95  public static void Debug(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
96  {
97  if (parameters == null) throw new ArgumentNullException("parameters");
98  Debug(log, string.Format(messageFormat, parameters), exception, Logger.ExtractCallerInfo(parameters));
99  }
100  /// <summary>
101  /// Logs the specified info message with an exception.
102  /// </summary>
103  /// <param name="message">The info message.</param>
104  /// <param name="exception">An exception to log with the message.</param>
105  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
106  public static void Info(this ILogger log, string message, Exception exception, CallerInfo callerInfo = null)
107  {
108  log.Log(new LogMessage(log.Module, LogMessageType.Info, message, exception, callerInfo));
109  }
110 
111  /// <summary>
112  /// Logs the specified info message.
113  /// </summary>
114  /// <param name="message">The info message.</param>
115  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
116  public static void Info(this ILogger log, string message, CallerInfo callerInfo = null)
117  {
118  Info(log, message, null, callerInfo);
119  }
120 
121  /// <summary>
122  /// Logs the specified info message.
123  /// </summary>
124  /// <param name="messageFormat">The info message to format.</param>
125  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
126  public static void Info(this ILogger log, string messageFormat, params object[] parameters)
127  {
128  Info(log, messageFormat, null, parameters);
129  }
130 
131  /// <summary>
132  /// Logs the specified info message with an exception.
133  /// </summary>
134  /// <param name="messageFormat">The info message to format.</param>
135  /// <param name="exception">An exception to log with the message.</param>
136  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
137  /// <exception cref="System.ArgumentNullException"></exception>
138  public static void Info(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
139  {
140  if (parameters == null) throw new ArgumentNullException("parameters");
141  Info(log, string.Format(messageFormat, parameters), exception, Logger.ExtractCallerInfo(parameters));
142  }
143  /// <summary>
144  /// Logs the specified warning message with an exception.
145  /// </summary>
146  /// <param name="message">The warning message.</param>
147  /// <param name="exception">An exception to log with the message.</param>
148  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
149  public static void Warning(this ILogger log, string message, Exception exception, CallerInfo callerInfo = null)
150  {
151  log.Log(new LogMessage(log.Module, LogMessageType.Warning, message, exception, callerInfo));
152  }
153 
154  /// <summary>
155  /// Logs the specified warning message.
156  /// </summary>
157  /// <param name="message">The warning message.</param>
158  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
159  public static void Warning(this ILogger log, string message, CallerInfo callerInfo = null)
160  {
161  Warning(log, message, null, callerInfo);
162  }
163 
164  /// <summary>
165  /// Logs the specified warning message.
166  /// </summary>
167  /// <param name="messageFormat">The warning message to format.</param>
168  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
169  public static void Warning(this ILogger log, string messageFormat, params object[] parameters)
170  {
171  Warning(log, messageFormat, null, parameters);
172  }
173 
174  /// <summary>
175  /// Logs the specified warning message with an exception.
176  /// </summary>
177  /// <param name="messageFormat">The warning message to format.</param>
178  /// <param name="exception">An exception to log with the message.</param>
179  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
180  /// <exception cref="System.ArgumentNullException"></exception>
181  public static void Warning(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
182  {
183  if (parameters == null) throw new ArgumentNullException("parameters");
184  Warning(log, string.Format(messageFormat, parameters), exception, Logger.ExtractCallerInfo(parameters));
185  }
186  /// <summary>
187  /// Logs the specified error message with an exception.
188  /// </summary>
189  /// <param name="message">The error message.</param>
190  /// <param name="exception">An exception to log with the message.</param>
191  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
192  public static void Error(this ILogger log, string message, Exception exception, CallerInfo callerInfo = null)
193  {
194  log.Log(new LogMessage(log.Module, LogMessageType.Error, message, exception, callerInfo));
195  }
196 
197  /// <summary>
198  /// Logs the specified error message.
199  /// </summary>
200  /// <param name="message">The error message.</param>
201  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
202  public static void Error(this ILogger log, string message, CallerInfo callerInfo = null)
203  {
204  Error(log, message, null, callerInfo);
205  }
206 
207  /// <summary>
208  /// Logs the specified error message.
209  /// </summary>
210  /// <param name="messageFormat">The error message to format.</param>
211  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
212  public static void Error(this ILogger log, string messageFormat, params object[] parameters)
213  {
214  Error(log, messageFormat, null, parameters);
215  }
216 
217  /// <summary>
218  /// Logs the specified error message with an exception.
219  /// </summary>
220  /// <param name="messageFormat">The error message to format.</param>
221  /// <param name="exception">An exception to log with the message.</param>
222  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
223  /// <exception cref="System.ArgumentNullException"></exception>
224  public static void Error(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
225  {
226  if (parameters == null) throw new ArgumentNullException("parameters");
227  Error(log, string.Format(messageFormat, parameters), exception, Logger.ExtractCallerInfo(parameters));
228  }
229  /// <summary>
230  /// Logs the specified fatal message with an exception.
231  /// </summary>
232  /// <param name="message">The fatal message.</param>
233  /// <param name="exception">An exception to log with the message.</param>
234  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
235  public static void Fatal(this ILogger log, string message, Exception exception, CallerInfo callerInfo = null)
236  {
237  log.Log(new LogMessage(log.Module, LogMessageType.Fatal, message, exception, callerInfo));
238  }
239 
240  /// <summary>
241  /// Logs the specified fatal message.
242  /// </summary>
243  /// <param name="message">The fatal message.</param>
244  /// <param name="callerInfo">Information about the caller. Default is null, otherwise use <see cref="CallerInfo.Get"/>.</param>
245  public static void Fatal(this ILogger log, string message, CallerInfo callerInfo = null)
246  {
247  Fatal(log, message, null, callerInfo);
248  }
249 
250  /// <summary>
251  /// Logs the specified fatal message.
252  /// </summary>
253  /// <param name="messageFormat">The fatal message to format.</param>
254  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
255  public static void Fatal(this ILogger log, string messageFormat, params object[] parameters)
256  {
257  Fatal(log, messageFormat, null, parameters);
258  }
259 
260  /// <summary>
261  /// Logs the specified fatal message with an exception.
262  /// </summary>
263  /// <param name="messageFormat">The fatal message to format.</param>
264  /// <param name="exception">An exception to log with the message.</param>
265  /// <param name="parameters">The parameters to used with the <see cref="messageFormat" />. The last parameter can be used to store <see cref="CallerInfo"/></param>
266  /// <exception cref="System.ArgumentNullException"></exception>
267  public static void Fatal(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
268  {
269  if (parameters == null) throw new ArgumentNullException("parameters");
270  Fatal(log, string.Format(messageFormat, parameters), exception, Logger.ExtractCallerInfo(parameters));
271  }
272  }
273 }
static void Error(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
Logs the specified error message with an exception.
static void Verbose(this ILogger log, string messageFormat, params object[] parameters)
Logs the specified verbose message.
string Module
Gets the module this logger refers to.
Definition: ILogger.cs:14
static void Warning(this ILogger log, string messageFormat, params object[] parameters)
Logs the specified warning message.
static void Debug(this ILogger log, string message, CallerInfo callerInfo=null)
Logs the specified debug message.
static void Debug(this ILogger log, string messageFormat, params object[] parameters)
Logs the specified debug message.
static void Debug(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
Logs the specified debug message with an exception.
static void Debug(this ILogger log, string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified debug message with an exception.
static void Warning(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
Logs the specified warning message with an exception.
A Fatal error message (level 5).
A class to store Caller Information attributes.
Definition: CallerInfo.cs:10
A debug message (level 0).
static void Verbose(this ILogger log, string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified verbose message with an exception.
static void Verbose(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
Logs the specified verbose message with an exception.
A verbose message (level 1).
static void Info(this ILogger log, string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified info message with an exception.
static void Error(this ILogger log, string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified error message with an exception.
Base implementation for ILogger.
Definition: Logger.cs:10
static void Fatal(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
Logs the specified fatal message with an exception.
static void Verbose(this ILogger log, string message, CallerInfo callerInfo=null)
Logs the specified verbose message.
static void Info(this ILogger log, string messageFormat, params object[] parameters)
Logs the specified info message.
static void Info(this ILogger log, string message, CallerInfo callerInfo=null)
Logs the specified info message.
LogMessageType
Type of a LogMessage.
static void Fatal(this ILogger log, string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified fatal message with an exception.
static void Error(this ILogger log, string message, CallerInfo callerInfo=null)
Logs the specified error message.
An error message (level 4).
A base log message used by the logging infrastructure.
Definition: LogMessage.cs:13
static void Error(this ILogger log, string messageFormat, params object[] parameters)
Logs the specified error message.
An regular info message (level 2).
static void Warning(this ILogger log, string message, CallerInfo callerInfo=null)
Logs the specified warning message.
static void Fatal(this ILogger log, string message, CallerInfo callerInfo=null)
Logs the specified fatal message.
Interface for logging.
Definition: ILogger.cs:8
static void Fatal(this ILogger log, string messageFormat, params object[] parameters)
Logs the specified fatal message.
static void Warning(this ILogger log, string message, Exception exception, CallerInfo callerInfo=null)
Logs the specified warning message with an exception.
A warning message (level 3).
static void Info(this ILogger log, string messageFormat, Exception exception, params object[] parameters)
Logs the specified info message with an exception.