-
Notifications
You must be signed in to change notification settings - Fork 115
RSDK-10245 Use VIAM_MODULE_NAME as logger name for golang module loggers #4850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSDK-10245 Use VIAM_MODULE_NAME as logger name for golang module loggers #4850
Conversation
// string if not specified in environment.) | ||
if moduleName == "" { | ||
moduleName, _ = os.LookupEnv("VIAM_MODULE_NAME") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a couple different ways to do this. Both ModularMain
and NewModuleFromArgs
call NewLoggerFromArgs("")
, so this is what I chose to do. Could also pass in VIAM_MODULE_NAME
to NewLoggerFromArgs
from both those call sites. Don't want to break any of this module API though for existing modules (e.g. not take in a moduleName
parameter to this function.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm, maybe add something to the comment saying this will happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// string if not specified in environment.) | ||
if moduleName == "" { | ||
moduleName, _ = os.LookupEnv("VIAM_MODULE_NAME") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sgtm, maybe add something to the comment saying this will happen?
RSDK-10245
Uses
VIAM_MODULE_NAME
as the logger name for loggers created throughNewLoggerFromArgs
if passed inmoduleName
is""
.Golang modular resource logs that used to look like:
now look like: