You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
935 B

  1. %%% Packages rebar.hrl features and macros into a more generic API
  2. %%% that can be used by plugin builders.
  3. -module(rebar_api).
  4. -include("rebar.hrl").
  5. -export([abort/0, abort/2,
  6. console/2,
  7. debug/2, info/2, warn/2, error/2]).
  8. -export_type([rebar_dict/0, rebar_digraph/0]).
  9. %%%%%%%%%%%%%%%%%%%%%%%
  10. %%% Error reporting %%%
  11. %%%%%%%%%%%%%%%%%%%%%%%
  12. %% @doc Interrupts program flow
  13. abort() -> ?FAIL.
  14. %% @doc like {@link error/2}, except it also raises an
  15. %% exception to interrupt program flow.
  16. abort(Str, Args) -> ?ABORT(Str, Args).
  17. %% @doc Prints to the console, including a newline
  18. console(Str, Args) -> ?CONSOLE(Str, Args).
  19. %% @doc logs with severity `debug'
  20. debug(Str, Args) -> ?DEBUG(Str, Args).
  21. %% @doc logs with severity `info'
  22. info(Str, Args) -> ?INFO(Str, Args).
  23. %% @doc logs with severity `warn'
  24. warn(Str, Args) -> ?WARN(Str, Args).
  25. %% @doc logs with severity `error'
  26. error(Str, Args) -> ?ERROR(Str, Args).