-
Notifications
You must be signed in to change notification settings - Fork 15
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
Change printf to PDC logger #232
base: develop
Are you sure you want to change the base?
Conversation
9a102b1
to
b5f8832
Compare
b5f8832
to
cf63b42
Compare
cf63b42
to
71ed74b
Compare
Still working on the clang-format I ran it on the codebase I'll look at what the cd/ci scripts do... |
Also removed large blocks of comments and chanegd the pdc logger to print the file name, function, and line number.
71ed74b
to
1e0534c
Compare
examples/haccio.c
Outdated
@@ -77,7 +77,7 @@ create_pdc_object(pdcid_t pdc_id, pdcid_t cont_id, const char *obj_name, pdc_var | |||
|
|||
pdcid_t obj_id = PDCobj_create_mpi(cont_id, obj_name, *obj_prop, 0, comm); | |||
if (obj_id == 0) { | |||
printf("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); | |||
LOG_INFO("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); |
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.
LOG_ERROR or LOG_INFO?
examples/haccio.c
Outdated
@@ -142,7 +142,7 @@ main(int argc, char **argv) | |||
for (i = 0; i < NUM_VARS; i++) { | |||
ret = PDCreg_obtain_lock(obj_ids[i], region_remote_ids[i], PDC_WRITE, PDC_NOBLOCK); | |||
if (ret != SUCCEED) { | |||
printf("Fail to obtain lock @ line %d!\n", __LINE__); | |||
LOG_INFO("Fail to obtain lock"); |
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.
LOG_ERROR or LOG_INFO?
examples/haccio.c
Outdated
@@ -174,7 +174,7 @@ main(int argc, char **argv) | |||
for (i = 0; i < NUM_VARS; i++) { | |||
ret = PDCreg_release_lock(obj_ids[i], region_remote_ids[i], PDC_WRITE); | |||
if (ret != SUCCEED) { | |||
printf("Fail to release lock @ line %d!\n", __LINE__); | |||
LOG_INFO("Fail to release lock"); |
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.
LOG_ERROR or LOG_INFO? There are several similar ones in this file.
examples/haccio_v2.c
Outdated
@@ -78,7 +78,7 @@ create_pdc_object(pdcid_t pdc_id, pdcid_t cont_id, const char *obj_name, pdc_var | |||
|
|||
pdcid_t obj_id = PDCobj_create_mpi(cont_id, obj_name, *obj_prop, 0, comm); | |||
if (obj_id == 0) { | |||
printf("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); | |||
LOG_INFO("Error getting an object id of %s from server, exit...\n", "obj-var-xx"); |
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.
LOG_ERROR or LOG_INFO?
|
||
if (!tif) | ||
printf("tiff:threadError | File \"%s\" cannot be opened\n", fileName); | ||
LGO_ERROR("tiff:threadError | File \"%s\" cannot be opened\n", fileName); |
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.
LGO_ERROR --> LOG_ERROR. This may be caught by compiler.
examples/obj_get_data.c
Outdated
} | ||
|
||
// close a container | ||
if (PDCcont_close(cont) < 0) { | ||
printf("fail to close container c1\n"); | ||
LOG_INFO("Fail to close container c1\n"); |
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.
LOG_ERROR or LOG_INFO?
examples/pdc_init.c
Outdated
|
||
// close pdc | ||
if (PDCclose(pdc) < 0) { | ||
printf("fail to close PDC\n"); | ||
LOGI("fail to close PDC\n"); |
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.
"failed to close PDC."
examples/obj_get_data.c
Outdated
} | ||
// close pdc | ||
if (PDCclose(pdc) < 0) { | ||
printf("fail to close PDC\n"); | ||
LOG_INFO("Fail to close PDC\n"); |
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.
"Failed to close PDC"
examples/obj_get_data.c
Outdated
ret_value = 1; | ||
} | ||
else { | ||
printf("successfully close container property\n"); | ||
LOG_INFO("successfully close container property\n"); |
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.
closed
examples/obj_get_data.c
Outdated
} | ||
// close a container property | ||
if (PDCprop_close(cont_prop) < 0) { | ||
printf("Fail to close property @ line %d\n", __LINE__); | ||
LOG_INFO("Fail to close property"); |
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.
Failed
examples/obj_get_data.c
Outdated
ret_value = 1; | ||
} | ||
else { | ||
printf("successfully close container c1\n"); | ||
LOG_INFO("successfully close container c1\n"); |
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.
closed
examples/read_write_perf.c
Outdated
@@ -129,26 +129,26 @@ main(int argc, char **argv) | |||
// create a container property | |||
cont_prop = PDCprop_create(PDC_CONT_CREATE, pdc); | |||
if (cont_prop <= 0) { | |||
printf("Fail to create container property @ line %d!\n", __LINE__); | |||
LOG_INFO("Fail to create container property"); |
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.
while we are at it, correct the grammar as well. "Failed"
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.
@TheAssembler1 can you also add to the documentation about these new macros and how to use them? You can add a subsection in Developer Notes
I didn't create the logging macros they were already there just no one was using them. Yes I will add documentation for them. |
Ok I added docs for each of the macros in the developer notes. |
This is a large commit but I think it is very beneficial for all logging to go through the PDC logger. This way we get the filename, function name, and line numbers for all logging.
Also removed large blocks of comments and changed the PDC logger to print the file name, function, and line number.
We can now remove a lot of the code that manually printed the line numbers for debugging and error identification reasons.