/// <summary>
 /// Creates an <see cref="IContextExceptionLogger"/>.
 /// </summary>
 /// <param name="projectId">The Google Cloud Platform project ID.  If unspecified and running
 /// on GAE or GCE the project ID will be detected from the platform.</param>
 /// <param name="serviceName"> An identifier of the service, such as the name of the executable or job. Cannot be null.</param>
 /// <param name="version">Represents the source code version that the developer provided. Cannot be null.</param>
 /// <param name="options">The error reporting options. Can be null, if null default options will be used.</param>
 /// <returns>An <see cref="IContextExceptionLogger"/> for the given options.</returns>
 public static IContextExceptionLogger Create(string projectId, string serviceName,
                                              string version, ErrorReportingOptions options)
 {
     GaxPreconditions.CheckNotNull(serviceName, nameof(serviceName));
     GaxPreconditions.CheckNotNull(version, nameof(version));
     return(ErrorReportingContextExceptionLogger.Create(projectId, serviceName, version, options));
 }
 /// <summary>
 /// Creates an <see cref="IContextExceptionLogger"/>.
 /// </summary>
 /// <param name="options">The error reporting options. May be null, in which case defaults will be used, in
 /// particular, if running on Google Cloud, the Google Cloud project ID to log to will be detected from
 /// the platform.</param>
 /// <param name="serviceProvider">The service provider to obtain services from. May be null,
 /// in which case some context information won't be added to the LogEntry.</param>
 /// <returns>An <see cref="IContextExceptionLogger"/> for the given options.</returns>
 public static IContextExceptionLogger Create(ErrorReportingServiceOptions options, IServiceProvider serviceProvider) =>
 ErrorReportingContextExceptionLogger.Create(options, serviceProvider);
示例#3
0
 /// <summary>
 /// Creates an <see cref="IContextExceptionLogger"/>.
 /// </summary>
 /// <param name="projectId">The Google Cloud Platform project ID.  If unspecified and running
 /// on GAE or GCE the project ID will be detected from the platform.</param>
 /// <param name="serviceName"> An identifier of the service, such as the name of the executable or job. May be null.</param>
 /// <param name="version">Represents the source code version that the developer provided. May be null.</param>
 /// <param name="options">The error reporting options. Can be null, if null default options will be used.</param>
 /// <returns>An <see cref="IContextExceptionLogger"/> for the given options.</returns>
 public static IContextExceptionLogger Create(string projectId, string serviceName, string version, ErrorReportingOptions options) =>
 ErrorReportingContextExceptionLogger.Create(projectId, serviceName, version, options);