Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

41 righe
1.3 KiB

14 anni fa
  1. * Overview
  2. Lager (pronounced lAAger) is a logging framework for Erlang. Its purpose is
  3. to provide a more traditional way to perform logging in an erlang application
  4. that plays nicely with traditional UNIX logging tools like logrotate and
  5. syslog.
  6. Features
  7. - Finer grained log levels (debug, info, notice, warning, error, critical,
  8. alert, emergency)
  9. - Logger calls are transformed using a parse transform to allow capturing
  10. Module/Function/Line/Pid information
  11. - When no handler is consuming a log level (eg. debug) no event is even sent
  12. to the log handler
  13. - Supports multiple backends, including console, file and syslog.
  14. * Usage
  15. To use lager in your application, you need to define it as a rebar dep or have
  16. some other way of including it in erlang's path. You can then add the
  17. following option to the erlang compiler flags
  18. {parse_transform, lager_transform}
  19. Alternately, you can add it to the module you which to compile with logging
  20. enabled:
  21. -compile([{parse_transform, lager_transform}]).
  22. Once you have built your code with lager, you can then generate log messages
  23. by doing the following:
  24. lager:error("Some message")
  25. Or:
  26. lager:warning("Some message with a term: ~p", [Term])
  27. The general form is lager:Severity() where Severity is one of the log levels
  28. mentioned above.
  29. * Configuration
  30. TODO