-
Notifications
You must be signed in to change notification settings - Fork 39
fix logger when enabled thru ctl #1503
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
base: main
Are you sure you want to change the base?
Conversation
173ce1a
to
84d93d8
Compare
test/ctl/ctl_env_app.cpp
Outdated
<< buf << "'" << std::endl; | ||
return 1; | ||
} | ||
int level = 0; |
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.
move int to the top of the file, I guess
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.
done
test/ctl/ctl_env_app.cpp
Outdated
char buf[256] = {0}; | ||
|
||
if (argc != 2) { | ||
std::cerr << "expected even number of arguments" << std::endl; |
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.
even? or just 2
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.
done
return UMF_RESULT_SUCCESS; | ||
} | ||
if (size < strlen(loggerConfig.file_name)) { | ||
LOG_ERR("Invalid output argument size: %zu, expected at least %zu", |
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.
output
or file_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.
user asked for umf.logger.output so output
@@ -198,11 +198,13 @@ static void *ctl_parse_args(const struct ctl_argument *arg_proto, char *arg) { | |||
* structure as required by the node callback |
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.
can you please write at least one line of description in the commit msg, why this fix?
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.
done
Logger configuration failed when set via the CTL env variable because the API used const char ** while the env var provided const char *. This mismatch affected the size field (sizeof(char *)==8 vs. string length). The API now accepts char * instead of char **.
Logger configuration failed when set via the CTL env variable because
the API used const char ** while the env var provided const
char *. This mismatch affected the size field (sizeof(char *)==8
vs. string length).
The API now accepts char * instead of char **.