8000 Support default values via Block · Issue #54 · luckyframework/habitat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Support default values via Block #54
Open
@robacarp

Description

@robacarp

Hey folks,

I'm integrating this over at robacarp/mosquito, which is currently taking configuration from an environment variable. In my current situation, it would be nice to be able to emit a message when a default value is rendered. In this case it would be a deprecation notice:

module Mosquito
  Habitat.create do
    setting redis_url : String do
      Log.warn {
        <<-error_message
        Configuring the Mosquito redis connection via environment variable is deprecated as of 2020-11.

        The functionality will be removed in the next _minor_ version bump, 0.9.0.

        See: https://github.com/robacarp/mosquito#connecting-to-redis
        error_message
      }

      (ENV["REDIS_URL"]? || "redis://localhost:6379")
    end
  end
end

Maybe this would be otherwise useful, maybe not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA new requested feature / optionhacktoberfestValid Issue for Hacktoberfest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0