z (zotonic_core v1.0.0-rc.14)

Some easy shortcut and error logging functions.

Link to this section Summary

Functions

Return a new context
(Re)make all erlang source modules with the supplied compile options. Do not reset the caches.
Log a debug message to the logs and the database, with extra meta data. To add the current source location, use the ?zDebug macro.
Echo and return a debugging value. This is useful for adding debug anywhere in the code, as the passed argument is also returned. Example: foo( ?DEBUG(Arg) ) will add Arg as a notice to the logs and still call foo(Arg).
Return the complete dispatch information for the site.
Shell command: dispatch a path, return trace
Dispatch an URL - find matching site and dispatch the path
Log a error to the logs and the database, with extra meta data. To add the current source location, use the ?zError macro.
Log a fatal error to the logs and the database, with extra meta data. To add the current source location, use the ?zError macro.
Reset all caches, reload the dispatch rules and rescan all modules.
Log an informational message to the logs and the database, with extra meta data. To add the current source location, use the ?zInfo macro.
Reload all changed Erlang modules
Reload an Erlang module
m()
(Re)make all erlang source modules and reset the caches.
Send a notification to the first observer
Send a notification
Log a notice to the logs and the database, with extra meta data. To add the current source location, use the ?zNotice macro.
Reindex all sites, find new files.
Full restart of Zotonic
Restart a site
Shell commands: stop a site
Shell commands: start a site
Shell commands: stop a site
Log a warning to the logs and the database, with extra meta data. To add the current source location, use the ?zWarning macro.

Link to this section Types

-type context() :: #context{}.
Link to this type

environment/0

-type environment() :: development | test | acceptance | production | education | backup.
-type qvalue() :: binary() | string() | #upload{} | term().
-type severity() :: debug | info | notice | warning | error | fatal.
-type trans() :: #trans{}.
Link to this type

validation_error/0

-type validation_error() :: invalid | novalue | {script, iodata()} | novalidator | string().

Link to this section Functions

-spec c(atom()) -> z:context().
Return a new context
(Re)make all erlang source modules with the supplied compile options. Do not reset the caches.
Link to this function

debug(Msg, Context)

Log a debug message to the logs and the database, with extra meta data. To add the current source location, use the ?zDebug macro.
Link to this function

debug(Msg, Meta, Context)

Link to this function

debug(Format, Args, Meta, Context)

Link to this function

debug_msg(Msg, Meta)

Echo and return a debugging value. This is useful for adding debug anywhere in the code, as the passed argument is also returned. Example: foo( ?DEBUG(Arg) ) will add Arg as a notice to the logs and still call foo(Arg).
Link to this function

dispatch_list(SiteOrContext)

Return the complete dispatch information for the site.
Link to this function

dispatch_path(Path, Site)

Shell command: dispatch a path, return trace
Link to this function

dispatch_url(Url)

Dispatch an URL - find matching site and dispatch the path
Link to this function

error(Msg, Context)

Log a error to the logs and the database, with extra meta data. To add the current source location, use the ?zError macro.
Link to this function

error(Msg, Meta, Context)

Link to this function

error(Format, Args, Meta, Context)

Link to this function

fatal(Msg, Context)

Log a fatal error to the logs and the database, with extra meta data. To add the current source location, use the ?zError macro.
Link to this function

fatal(Msg, Meta, Context)

Link to this function

fatal(Format, Args, Meta, Context)

-spec flush() -> ok.
Reset all caches, reload the dispatch rules and rescan all modules.
-spec flush(atom() | z:context()) -> ok.
Link to this function

info(Msg, Context)

Log an informational message to the logs and the database, with extra meta data. To add the current source location, use the ?zInfo macro.
Link to this function

info(Msg, Meta, Context)

Link to this function

info(Format, Args, Meta, Context)

Reload all changed Erlang modules
Reload an Erlang module
Link to this function

log(Level, Meta, Context)

-spec log(Level :: severity(), Meta :: proplists:proplist() | map(), Context :: z:context()) -> ok.
(Re)make all erlang source modules and reset the caches.
Link to this function

n1(Msg, Context)

Send a notification to the first observer
Link to this function

n(Msg, Context)

Send a notification
Link to this function

notice(Msg, Context)

Log a notice to the logs and the database, with extra meta data. To add the current source location, use the ?zNotice macro.
Link to this function

notice(Msg, Meta, Context)

Link to this function

notice(Format, Args, Meta, Context)

Reindex all sites, find new files.
Full restart of Zotonic
Restart a site
Link to this function

shell_restartsite(Site)

Shell commands: stop a site
Link to this function

shell_startsite(Site)

Shell commands: start a site
Link to this function

shell_stopsite(Site)

Shell commands: stop a site
Link to this function

warning(Msg, Context)

Log a warning to the logs and the database, with extra meta data. To add the current source location, use the ?zWarning macro.
Link to this function

warning(Msg, Meta, Context)

Link to this function

warning(Format, Args, Meta, Context)