code: def debug_option(f):
      
      def callback(ctx, param, value):
          state = ctx.ensure_object(Context)
          state.debug = value
          return value
  
      return click.option('--debug',
                          expose_value=False,
                          is_flag=True,
                          envvar="SAM_DEBUG",
                          help='Turn on debug logging to print debug message generated by SAM CLI.',
                          callback=callback)(f)
docs: Configures --debug option for CLI
  
      :param f: Callback Function to be passed to Click