Updated v2: Writing a Module (markdown)

Matt Holt 2019-12-06 11:26:17 -07:00
parent 65c04adfa3
commit e272ea0baa

@ -173,6 +173,8 @@ This is typically where host modules will load their guest/child modules, but it
Provisioning MUST NOT depend on other apps; since provisioning is when modules are loaded. To rely on other app modules, you must wait until after the Provision phase. The provisioning of apps is done in an arbitrary order. Provisioning MUST NOT depend on other apps; since provisioning is when modules are loaded. To rely on other app modules, you must wait until after the Provision phase. The provisioning of apps is done in an arbitrary order.
Additionally, you should avoid performing "expensive" operations in Provision, since provisioning is performed even if a config is only being validated.
### Logs ### Logs
If your module emits logs, **do not use `log.Print*()` from the Go standard library**. In other words, do not use Go's global logger. Caddy uses high-performance, highly flexible, structured logging with [zap](https://github.com/uber-go/zap). If your module emits logs, **do not use `log.Print*()` from the Go standard library**. In other words, do not use Go's global logger. Caddy uses high-performance, highly flexible, structured logging with [zap](https://github.com/uber-go/zap).