Phauxth v0.11.0 Phauxth.Log

Logging functions for Phauxth.

Format

Phauxth uses logfmt to provide a standard logging format.

15:31:08.575 [warn] user=ray@mail.com message=”invalid password”

  • user - the user identifier (one of email, username, nil)
  • message - error / info message
  • meta - additional metadata that does not fit into any of the other categories

Log levels

The available log levels are :info, :warn and false.

The level at which logging starts can be configured by changing the log_level value in the config file.

The default log_level is :info, but if you only want warnings printed out, add the following to the config file:

config :phauxth,
  log_level: :warn

And if you do not want Phauxth to print out any logs, set the log_level to false.

Summary

Functions

Returns the id of the currently logged-in user, if present

Returns the debug log message

Returns the error log message

Returns the info log message

Returns the warn log message

Functions

current_user_id(arg1)

Returns the id of the currently logged-in user, if present.

debug(log)

Returns the debug log message.

error(log)

Returns the error log message.

info(log)

Returns the info log message.

warn(log)

Returns the warn log message.