When implementing a server, sometimes you might want to decorate all methods (effects or streams) in the service, for example to add access and error logging.
It can be done with the help of
ZTransform. Instances of this class can be used
to apply a transformation to all methods of a service to generate a new "decorated" service.
This can be used for pre- or post-processing of requests/responses and also for environment
and context transformations.
We define decoration:
and then we apply it to our service: