-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add log keeping functionality #49
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
charmitro
requested changes
Feb 28, 2024
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.
panosfol
force-pushed
the
email-refactor
branch
from
February 28, 2024 20:13
e4c22b7
to
974153d
Compare
panosfol
force-pushed
the
email-refactor
branch
from
February 28, 2024 20:21
0e8186c
to
082d331
Compare
panosfol
force-pushed
the
email-refactor
branch
from
February 29, 2024 12:00
082d331
to
0bceb38
Compare
charmitro
requested changes
Mar 1, 2024
charmitro
requested changes
Mar 5, 2024
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.
First round.
charmitro
requested changes
Mar 5, 2024
charmitro
reviewed
Mar 5, 2024
charmitro
requested changes
Mar 5, 2024
This commit contains the necessary changes for log keeping as well as a new section [general] for the `.ini` file with `log_filepath` as a new field. Changelog: config.h: add [general] section and `log_filepath` field & a new struct to hold the value of the `.ini` file config.c: add parsing of the new section log.h: - add a new macro similar to pr_{debug|info|error|warn} that writes - both to the log file and the STDOUT/STDERR - add macro for `LOG_FILEPATH` and `LOG_FILENAME` - add `construct_log_filepath` function, which is responsible for creating and checking the necessary permissions for log-keeping directory. - add `construct_log_filename` function that creates the name of the log file with the format `cncDDMMYY_HHMMSS.log`. util.h: - add `mkdir_p` function to create iteratively the parent directories of a user defined path. - add `cnc_strdup` function that calls `strdup` and checks if the call was successful. config.c: change `initialize_config` to construct the log file utilizing the new functions added to `log.h` cnc.c: add error handling if `initialize_config` fails to open the log file cnc_tests.c: add 2 tests for the new field Signed-off-by: Panagiotis Foliadis <pfoliadis@hotmail.com>
Utilize the `log` interface to create and append to a log file the results of the `pg_replicate`. postgres.c: util.c: utilize the new macro for appending to the log file remove the usage of variables around constructing an email body postgres.h: add `PG_DUMP_FILE` macro and change the declaration of `construct_pg` function to return an error code in case of not being able to open the `.log` file util.h: remove the unecessary arguments for the email body and size Signed-off-by: Panagiotis Foliadis <pfoliadis@hotmail.com>
Thanks! LGTM, merging. This means that #47 is unblocked and we can move forward with the implementation. |
charmitro
approved these changes
Mar 6, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is unfinished, i.e doesn't use the email interface, it needs #47 to be resolved first.
This closes #46