const mixinafIocEnv::IocEnv
afIocEnv::IocEnv
@Js
(Service) - Holds the environment with some handy utility methods.
Although a mixin, implementations may still be created with the following:
iocEnv := IocEnv()
Or pass in an override:
iocEnv := IocEnv("prod")
- abbr
abstract Str abbr()Returns the environment in abbreviated form;
dev, test, prod. Or just the env in lowercase if not recognised.- env
abstract Str env()Returns the environment Str.
- fromStr
static new fromStr(Str? environmentOverride := null)Create an
IocEnvwith the given (optional) environment override. This may be invoked via the ctor syntax:iocEnv := IocEnv("prod")- isDev
abstract Bool isDev()Returns
trueif the environment isdevordevelopment.- isEnv
Returns
trueif the environment matches the givenenvin a case insensitive match.- isProd
abstract Bool isProd()Returns
trueif the environment isprod,productionor undefined.- isStage
abstract Bool isStage()Returns
trueif the environment istestortesting.- isTest
abstract Bool isTest()Returns
trueif the environment istestortesting.- logToInfo
abstract Void logToInfo()Logs environment to info.