#atmos-dev (2024-10)
Discuss atmos core development (golang)
2024-10-12
@Erik Osterman (Cloud Posse) has joined the channel
@linen has joined the channel
@Andriy Knysh (Cloud Posse) has joined the channel
@Igor Rodionov has joined the channel
@Jeremy G (Cloud Posse) has joined the channel
@Matt Calhoun has joined the channel
set the channel topic: Discuss atmos core development (golang)
@haitham911eg has joined the channel
@Vinny has joined the channel
@haitham911eg lets move discussion here. @Andriy Knysh (Cloud Posse) can you help answer some questions to unblock him?
@Sahadat Hossain has joined the channel
@Andriy Knysh (Cloud Posse) it is related to the part func LogError log_utils.go line 85
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
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
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
u.LogError(cliConfig, err)
(no globals please, they will create a lot of issues)
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
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
Lets keep a list of improvements we can make. But stick with existing conventions so as not to increase the scope.
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
@Volodymyr has joined the channel
@david has joined the channel
@Michael has joined the channel