/// <summary> /// Logs the message of level "level" to the logger. /// </summary> /// <param name="configuration"></param> /// <param name="level">the level to log</param> /// <param name="message">the message to log</param> public static void Log(this IReadonlyEnvironmentConfiguration configuration, LogLevel level, object message) { if (configuration.HasValue(typeof(ILoggerFacade).FullName)) { configuration.GetValue <ILoggerFacade>(typeof(ILoggerFacade).FullName)?.Log(level, message); } }
/// <summary> /// Gets the value of the current type of value requested from the build method /// </summary> /// <param name="configuration"></param> /// <returns>the type requested</returns> public static Type GetBuildType(this IReadonlyEnvironmentConfiguration configuration) { return(configuration.GetValue <Type>(Constants.SourceRequiredTypeKey)); }
/// <summary> /// Gets the common key for the source or environment.See also <seealso cref="WithCommonKey"/> /// </summary> /// <param name="configuration"></param> /// <returns>the common key or null</returns> public static string GetCommonKey(this IReadonlyEnvironmentConfiguration configuration) { return(configuration.GetValue(Constants.SourceCommonKeyKey)); }
/// <summary> /// Gets the trace value /// </summary> /// <param name="configuration"></param> /// <returns>the trace value or null if not provided</returns> public static string GetTrace(this IReadonlyEnvironmentConfiguration configuration) { return(configuration.GetValue(Constants.SourceTraceValueKey)); }
/// <summary> /// Gets the environment variable prefix. Defaults to null /// </summary> /// <param name="configuration"></param> /// <returns>the prefix currently being used or null</returns> public static string GetEnvironmentVariablePrefix(this IReadonlyEnvironmentConfiguration configuration) { return(configuration.HasValue(Constants.EnvironmentVariablePrefixKey) ?configuration.GetValue(Constants.EnvironmentVariablePrefixKey) :null); }
/// <summary> /// Gets the value of the environment variable store used /// </summary> /// <param name="configuration"></param> /// <returns>the target currently used</returns> public static EnvironmentVariableTarget GetEnvironmentTarget(this IReadonlyEnvironmentConfiguration configuration) { return(configuration.HasValue(Constants.EnvironmentVariableTargetKey) ?configuration.GetValue <EnvironmentVariableTarget>(Constants.EnvironmentVariableTargetKey) : EnvironmentVariableTarget.Process); }