Hey team this is an important observation please c...
# atmos-dev
s
Hey team this is an important observation please check my comment: https://github.com/cloudposse/atmos/pull/896/files#r1899825937 @Andriy Knysh (Cloud Posse) or @Erik Osterman (Cloud Posse) might know if there are specific reasons for this (if they are aware of this) Currently i stand on the side that this should not work the way it is. Unless someone convinces me of the reasons these special file configs exists.
e
Correct, changing the destination of the logs, should have no bearing on what is emitted. That should be strictly controlled by the log level.
I have also noticed that setting the ATMOS_LOGS_LEVEL environment variable, or passing the —logs-level flag seems to have no bearing
Maybe it’s because we usually set the file to stderr
@Andriy Knysh (Cloud Posse) ☝️
s
I guess we should create a medium - high priority task to fix log level This is one of the basic thing we should not mess up. Ofcourse we can discuss the behavior before we standardize something Also just curioius. Do we have a document subscription like Norton or Quip where we propose and discuss stuff? or it is github issue? I am fine with github issue as well just wanted to know what we prefer😅
a
atmos logs level env variable has been working correctly
i’ll check your comments in a few
e
We have another task for @Vinny to implement the charm logger. We can do the work as part of that.
a
@Shubham Tholiya i commented on your comment
👀 1
if you have trouble with that, let's sync tomorrow with you, Erik and myself to discuss
note that the two places that you pointed out
Copy code
https://github.com/cloudposse/atmos/blob/main/pkg/logger/logger.go#L61-L98
https://github.com/cloudposse/atmos/blob/main/pkg/utils/log_utils.go#L106-L143
the second one is a new way of login, the second one is a very old code
(they will need to be consolidated eventually, all the old places need to be switched to use the new
Logger
)
e
When I discussed with @Matt Calhoun we decided to do a 2 phased approach. Update the current logging functions to use the charm logger, and everything new call the charm logger directly.
👍 1
s
@Andriy Knysh (Cloud Posse) I believe my initial concern was misunderstood, so I clarified it here: https://github.com/cloudposse/atmos/pull/896/files#r1900454315 Since we’re moving to a new logger, this issue might resolve itself, so it may not need further discussion. Just sharing this in case it’s helpful.
👍 1
a
@Shubham Tholiya i commented on your comment We have the correct handling of log levels and log files now via the top-level functions
LogTrace
,
LogDebug
,
LogInfo
(which are called from the
Go
code), and the internal (not exported) function
log
(which handles the log files and file descriptors
this is how the rest of the code calls the
LogXXX
functions
Copy code
// func "a" logs at the log level Info, meaning the messages will be logged when the configured log level is Info, Debug, Trace, etc.
func a() {
  LogInfo(..., "Starting doing something")
  .....
  LogInfo(..., "Finished doing something")
}

// func "b" logs at the log level Trace, meaning the messages will be logged only when the configured log level is Trace 
func b() {
  LogTrace(..., "Starting doing something")
  .....
  LogTrace(..., "Finished doing something")
}
only the code that actually logs (e.g the
a
and
b
funcs above) knows at what log level it wants the messages to be logged