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
IocEnv
with the given (optional) environment override. This may be invoked via the ctor syntax:iocEnv := IocEnv("prod")
- isDev
abstract Bool isDev()
Returns
true
if the environment isdev
ordevelopment
.- isEnv
Returns
true
if the environment matches the givenenv
in a case insensitive match.- isProd
abstract Bool isProd()
Returns
true
if the environment isprod
,production
or undefined.- isStage
abstract Bool isStage()
Returns
true
if the environment istest
ortesting
.- isTest
abstract Bool isTest()
Returns
true
if the environment istest
ortesting
.- logToInfo
abstract Void logToInfo()
Logs environment to info.