Skip to content

Commit

Permalink
improve deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoCaso committed Jul 3, 2023
1 parent 8deb36c commit b0a1cdb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/datadog/core/configuration/option_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ class OptionDefinition

attr_reader \
:default,
# experimental_default_proc is used when we want to store a block as part of the option value.
# Since this new option is experimental and we might not need it in the near future, I gave it a name that is
# clear to the reader that they should not rely on it and that is subject to change.
# Currently is only use internally.
:experimental_default_proc,
:delegate_to,
:depends_on,
Expand Down Expand Up @@ -88,10 +92,9 @@ def helper(name, *_args, &block)

def lazy(_value = true)
Datadog::Core.log_deprecation do
'The `lazy` option is deprecated. You no longer need to specify an option to be lazy '\
"when the default value is a block.\n"\
'In the case edge case that you need the default value to be a block, please use the the expriemntal option:'\
'experimental_default_proc'
"The `lazy` option is deprecated. You no longer can specify an option to be lazy.\n"\
'If the default value is block it would be evaluated as before when using lazy. '\
'In the case that the default value could be evaluated at runtime consider removing the block.'
end
end

Expand Down

0 comments on commit b0a1cdb

Please sign in to comment.