Module z

Some easy shortcuts and error logging functions.

Copyright © 2009-2023 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Some easy shortcuts and error logging functions.

Data Types

context()

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()}

environment()

environment() = development | test | acceptance | production | education | backup

qvalue()

qvalue() = binary() | string() | #upload{filename = binary() | undefined, tmpfile = file:filename_all() | undefined, tmpmonitor = undefined | pid(), data = binary() | undefined, mime = binary() | undefined} | term()

severity()

severity() = debug | info | notice | warning | error | fatal

trans()

trans() = #trans{tr = [{atom(), binary()}]}

validation_error()

validation_error() = invalid | novalue | {script, iodata()} | novalidator | string()

Function Index

c/1Return a new context.
compile/0(Re)make all erlang source modules with the supplied compile options.
debug/2Log a debug message to the logs and the database, with extra meta data.
debug/3
debug/4
debug_msg/2Echo and return a debugging value.
dispatch_list/1Return the complete dispatch information for the site.
dispatch_path/2Shell command: dispatch a path, return trace.
dispatch_url/1Dispatch an URL - find matching site and dispatch the path.
error/2Log a error to the logs and the database, with extra meta data.
error/3
error/4
fatal/2Log a fatal error to the logs and the database, with extra meta data.
fatal/3
fatal/4
flush/0Reset all caches, reload the dispatch rules and rescan all modules.
flush/1
info/2Log an informational message to the logs and the database, with extra meta data.
info/3
info/4
ld/0Reload all changed Erlang modules.
ld/1Reload an Erlang module.
log/3
m/0(Re)make all erlang source modules and reset the caches.
n/2Send a notification.
n1/2Send a notification to the first observer.
notice/2Log a notice to the logs and the database, with extra meta data.
notice/3
notice/4
open/1Open a site in Chrome or the default browser(macOS).
open_secure/1Open a site in a new fresh Chrome.
reindex/0Reindex all sites, find new files.
restart/0Full restart of Zotonic.
restart/1Restart a site.
shell_restartsite/1Shell commands: stop a site.
shell_startsite/1Shell commands: start a site.
shell_stopsite/1Shell commands: stop a site.
start/1Start a site.
stop/1Stop a site.
warning/2Log a warning to the logs and the database, with extra meta data.
warning/3
warning/4

Function Details

c/1

c(Site::atom()) -> z:context()

Return a new context

compile/0

compile() -> any()

(Re)make all erlang source modules with the supplied compile options. Do not reset the caches.

debug/2

debug(Msg, Context) -> any()

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

debug/3

debug(Msg, Meta, Context) -> any()

debug/4

debug(Format, Args, Meta, Context) -> any()

debug_msg/2

debug_msg(Msg, Meta) -> any()

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).

dispatch_list/1

dispatch_list(SiteOrContext) -> any()

Return the complete dispatch information for the site.

dispatch_path/2

dispatch_path(Path, Site) -> any()

Shell command: dispatch a path, return trace

dispatch_url/1

dispatch_url(Url) -> any()

Dispatch an URL - find matching site and dispatch the path

error/2

error(Msg, Context) -> any()

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

error/3

error(Msg, Meta, Context) -> any()

error/4

error(Format, Args, Meta, Context) -> any()

fatal/2

fatal(Msg, Context) -> any()

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

fatal/3

fatal(Msg, Meta, Context) -> any()

fatal/4

fatal(Format, Args, Meta, Context) -> any()

flush/0

flush() -> ok

Reset all caches, reload the dispatch rules and rescan all modules.

flush/1

flush(Site::atom() | z:context()) -> ok

info/2

info(Msg, Context) -> any()

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

info/3

info(Msg, Meta, Context) -> any()

info/4

info(Format, Args, Meta, Context) -> any()

ld/0

ld() -> any()

Reload all changed Erlang modules

ld/1

ld(Module) -> any()

Reload an Erlang module

log/3

log(Level::severity(), Meta::proplists:proplist() | map(), Context::z:context()) -> ok

m/0

m() -> any()

(Re)make all erlang source modules and reset the caches.

n/2

n(Msg, Context) -> any()

Send a notification

n1/2

n1(Msg, Context) -> any()

Send a notification to the first observer

notice/2

notice(Msg, Context) -> any()

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

notice/3

notice(Msg, Meta, Context) -> any()

notice/4

notice(Format, Args, Meta, Context) -> any()

open/1

open(Site) -> any()

Open a site in Chrome or the default browser(macOS)

open_secure/1

open_secure(Site) -> any()

Open a site in a new fresh Chrome

reindex/0

reindex() -> any()

Reindex all sites, find new files.

restart/0

restart() -> any()

Full restart of Zotonic

restart/1

restart(Site) -> any()

Restart a site

shell_restartsite/1

shell_restartsite(Site) -> any()

Shell commands: stop a site

shell_startsite/1

shell_startsite(Site) -> any()

Shell commands: start a site

shell_stopsite/1

shell_stopsite(Site) -> any()

Shell commands: stop a site

start/1

start(Site) -> any()

Start a site

stop/1

stop(Site) -> any()

Stop a site

warning/2

warning(Msg, Context) -> any()

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

warning/3

warning(Msg, Meta, Context) -> any()

warning/4

warning(Format, Args, Meta, Context) -> any()


Generated by EDoc