Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lplewa
Copy link
Contributor

@lplewa lplewa commented Aug 21, 2025

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 **.

@lplewa lplewa requested a review from a team as a code owner August 21, 2025 12:36
@lplewa lplewa force-pushed the ctl_logger2 branch 2 times, most recently from 173ce1a to 84d93d8 Compare August 21, 2025 13:07
<< buf << "'" << std::endl;
return 1;
}
int level = 0;
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

char buf[256] = {0};

if (argc != 2) {
std::cerr << "expected even number of arguments" << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

even? or just 2

Copy link
Contributor Author

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

output or file_name?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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 **.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants