internal GoogleLogger(IConsumer <LogEntry> consumer, LogTarget logTarget, LoggerOptions loggerOptions,
                       string logName, IClock clock = null, IServiceProvider serviceProvider = null)
 {
     _logTarget   = GaxPreconditions.CheckNotNull(logTarget, nameof(logTarget));
     _traceTarget = logTarget.Kind == LogTargetKind.Project ?
                    TraceTarget.ForProject(logTarget.ProjectId) : null;
     _consumer            = GaxPreconditions.CheckNotNull(consumer, nameof(consumer));
     _loggerOptions       = GaxPreconditions.CheckNotNull(loggerOptions, nameof(loggerOptions));
     _logName             = GaxPreconditions.CheckNotNullOrEmpty(logName, nameof(logName));
     _fullLogName         = logTarget.GetFullLogName(_loggerOptions.LogName);
     _serviceProvider     = serviceProvider;
     _clock               = clock ?? SystemClock.Instance;
     _ambientScopeManager = new AmbientScopeManager(_loggerOptions, _serviceProvider);
 }
 internal GoogleLogger(IConsumer <LogEntry> consumer, LogTarget logTarget, Struct serviceContext, LoggingOptions loggerOptions, string logName,
                       Action <IServiceProvider, Dictionary <string, string> > obsoleteLabelsGetter,
                       Action <IServiceProvider, LogEntry, TraceTarget> obsoleteTraceContextGetter,
                       IClock clock = null, IServiceProvider serviceProvider = null)
 {
     _logTarget   = GaxPreconditions.CheckNotNull(logTarget, nameof(logTarget));
     _traceTarget = logTarget.Kind == LogTargetKind.Project ?
                    TraceTarget.ForProject(logTarget.ProjectId) : null;
     _serviceContext             = serviceContext;
     _consumer                   = GaxPreconditions.CheckNotNull(consumer, nameof(consumer));
     _loggerOptions              = GaxPreconditions.CheckNotNull(loggerOptions, nameof(loggerOptions));
     _logName                    = GaxPreconditions.CheckNotNullOrEmpty(logName, nameof(logName));
     _fullLogName                = logTarget.GetFullLogName(_loggerOptions.LogName);
     _serviceProvider            = serviceProvider;
     _clock                      = clock ?? SystemClock.Instance;
     _obsoleteTraceContextGetter = obsoleteTraceContextGetter;
     _ambientScopeManager        = new AmbientScopeManager(_loggerOptions, _serviceProvider, obsoleteLabelsGetter);
 }