Skip to content
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

Adding log level enums and a simplified log function #90

Merged
merged 1 commit into from
May 30, 2017

Conversation

epa095
Copy link
Contributor

@epa095 epa095 commented May 30, 2017

Added the function:
void log_add_message_str(log_type logh, message_level_type message_level , const char message);
which does not take in a dup_stream or a flag for freeing (it will not free the message as it is const)

@@ -26,12 +26,23 @@ extern "C" {
#include <stdbool.h>
#include <stdlib.h>

//Same as pythons default log levels, with numeric values equal to python / 10.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set them to python/10 to keep a bit of compability with the old levels, which is not defined anywhere, but it seems like 1 is used a lot, and that is also the default level. I am not able to see far enough in to the future to determine if it is better to change those and standarize on the same numeric values as python uses.

@@ -128,6 +128,17 @@ bool log_include_message(const log_type *logh , int message_level) {
return false;
}

/**
* Adds a string to the log if message_level is below the threshold
* @param logh The log to add to
Copy link
Contributor Author

Choose a reason for hiding this comment

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

My IDE adds this doxygen formating, but I see that they are not present elsewhere in the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

No - and they are dang ugly :-)

@epa095 epa095 changed the title WIP: Adding log level enums and a simplified log function Adding log level enums and a simplified log function May 30, 2017
@jokva jokva merged commit 5d9fd5a into equinor:master May 30, 2017
@epa095 epa095 deleted the log-extending branch May 30, 2017 10:52
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.

None yet

3 participants