Exemplo n.º 1
0
 /// <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 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);
 }