z (zotonic_core v1.0.0-rc.17)
Interfaces for command line utilities in zotonic_launcher, some easy shortcuts and error logging functions.
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 <tt>?zDebug</tt> 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: <tt>foo( ?DEBUG(Arg) )</tt> will add Arg as a notice to the logs and still call <tt>foo(Arg)</tt>.
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
Return the current environment
Log a error to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zError</tt> macro.
Log a fatal error to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zError</tt> 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 <tt>?zInfo</tt> macro.
Check if a module of a site is enabled.
Reload all changed Erlang modules
Reload an Erlang module
(Re)make all erlang source modules and reset the caches.
Send a notification to the first observer and return the result.
Send an async notification.
Log a notice to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zNotice</tt> macro.
Open a site in Chrome or the default browser(macOS)
Open a site in a new fresh Chrome
Reindex all sites, find new files.
Full restart of Zotonic
Restart a site
Set a runtime config value. This is useful to enable or disable certain runtime features without restarting Zotonic.
Shell commands: stop a site
Shell commands: start a site
Shell commands: stop a site
Start a site
Stop a site
Log a warning to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zWarning</tt> macro.
Types
-type context() :: #context{cowreq :: cowboy_req:req() | undefined, cowenv :: cowboy_middleware:env() | undefined, site :: atom(), controller_module :: atom() | undefined, client_id :: binary() | undefined, client_topic :: mqtt_sessions:topic() | undefined, routing_id :: binary() | undefined, acl :: term() | admin | undefined, acl_is_read_only :: boolean(), user_id :: integer() | authenticated | undefined, render_state :: undefined | z_render:render_state(), db :: {atom(), atom()} | undefined, dbc :: pid() | undefined, language :: [atom()], tz :: binary(), props :: map(), depcache :: pid() | atom(), dispatcher :: pid() | atom(), template_server :: pid() | atom(), scomp_server :: pid() | atom(), dropbox_server :: pid() | atom(), pivot_server :: pid() | atom(), module_indexer :: pid() | atom(), translation_table :: atom()}.
-type environment() :: development | test | acceptance | production | education | backup.
-type severity() :: debug | info | notice | warning | error | fatal.
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 <tt>?zDebug</tt> 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: <tt>foo( ?DEBUG(Arg) )</tt> will add Arg as a notice to the logs and still call <tt>foo(Arg)</tt>.
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
-spec env(Site :: atom()) -> environment().
Return the current environment
Log a error to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zError</tt> macro.
Log a fatal error to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zError</tt> macro.
-spec flush() -> ok.
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 <tt>?zInfo</tt> macro.
Check if a module of a site is enabled.
Reload all changed Erlang modules
Reload an Erlang module
-spec log(Level :: severity(), Meta :: proplists:proplist() | map(), Context :: z:context()) -> ok.
(Re)make all erlang source modules and reset the caches.
Send a notification to the first observer and return the result.
Send an async notification.
Log a notice to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zNotice</tt> macro.
Open a site in Chrome or the default browser(macOS)
Open a site in a new fresh Chrome
Reindex all sites, find new files.
Full restart of Zotonic
Restart a site
Set a runtime config value. This is useful to enable or disable certain runtime features without restarting Zotonic.
Shell commands: stop a site
Shell commands: start a site
Shell commands: stop a site
Start a site
Stop a site
Log a warning to the logs and the database, with extra meta data. To add the current source location, use the <tt>?zWarning</tt> macro.