<@UB89GSWCF> it is related to the part func LogErr...
# atmos-dev
h
@Andriy Knysh (Cloud Posse) it is related to the part func LogError log_utils.go line 85
Copy code
func LogError(cliConfig schema.CliConfiguration, err error)
the cliConfig has value cliConfig.Logs.Level on many cases on call func they pass empty value that force me to add global value branch https://github.com/cloudposse/atmos/tree/DEV-340
a
the LogError functions are called in many diff places
eirlier in the pipline (before
atmos.yaml
is parsed), we don't have
cliConfig
yet, so in those cases we use just an empty struct
Copy code
u.LogError(schema.CliConfiguration{}, err)
later in the pipeline, we have already parsed
atmos.yaml
and have
cliConfig
in all functions, so we use it
Copy code
u.LogError(cliConfig, err)
(no globals please, they will create a lot of issues)
h
yes I know that globals value causes issues but we have to keep tracking cliConfig.Logs.Level value
because we need to handle print logs according to lvl of log
I think we should use struct methods instead of normal functions so we can add schema.CliConfiguration{} to struct alternative we pass it on function args
on that case no need to global variable
a
we already passing
cliConfig
as func argument to all functions. In your new code, you can pass
cliConfig
using any method, including passing as func arg or as struct method
e
Lets keep a list of improvements we can make. But stick with existing conventions so as not to increase the scope.
h
Yes sure we have not increase the scope I just put points to be clear what we should to improve
Please @Andriy Knysh (Cloud Posse) review my code on logerror func You will see that I use the args on it
Anyway no need to worry about the global value that I added later we can improve But please think on how we can keep tracking log lvl value for all cases
a
@Haitham i'll review your PR
✅ 1