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

prival to string function #245

Closed
goatshriek opened this issue Oct 3, 2022 · 7 comments
Closed

prival to string function #245

goatshriek opened this issue Oct 3, 2022 · 7 comments
Labels
enhancement new features or improvements good first issue something that would be simple for a newcomer to stumpless to work on help wanted external contributations encouraged

Comments

@goatshriek
Copy link
Owner

Entries have both a facility and a severity, combined into a value called the prival. While the individual portions can be converted to strings already, the prival itself does not currently have a function to do this. This will be a necessary function to create in order to easily make an entry into a string. Your task is to implement this function.

General Approach

There are a few details left out of the following approach, for you to fill in as you encounter them. If you find you need help, please ask here or on the project gitter and someone can help you get past the stumbling block.

First, read this section of the development documentation on adding new functions. Once you understand how this process works, start defining the new function.

You'll need to create a new header file for this function, include/stumpless/prival.h. You can copy include/stumpless/severity.h as a template, and alter it as needed. Once this is done, add a new function with the following signature:

STUMPLESS_PUBLIC_FUNCTION
const char *
stumpless_get_prival_string( int prival );

Next, create a matching file src/prival.c to hold your implementation. You'll need to update the CMakeLists.txt file to include the new file in the build. Use the severity and facility to string functions to build the prival string. Use | to separate the severity and the facility strings, putting the severity first.

Finally, you'll need to also create a new test suite to hold the tests for your function. Once again, you can copy the test/function/severity.cpp test suite to hold your new test. And of course, you'll need to add this test suite to the CMake build file as well.

@goatshriek goatshriek added enhancement new features or improvements help wanted external contributations encouraged good first issue something that would be simple for a newcomer to stumpless to work on labels Oct 3, 2022
@mk722
Copy link

mk722 commented Oct 13, 2022

Hello, can you assign this issue to me please?

@mk722
Copy link

mk722 commented Oct 17, 2022

Sorry, I haven't started this issue yet, I had a lot in work, but I'll do it this week.

@goatshriek
Copy link
Owner Author

No worries, thanks very much for the update!

@mk722
Copy link

mk722 commented Oct 21, 2022

Hello, I wanted just to let you know, that I caught covid this week and I can't program at the moment because of it. Are you in a hurry with this issue? I suppose, that for the next week, if I feel better, I would have already finished it.

@goatshriek
Copy link
Owner Author

No worries at all, good first issues are specifically not time critical to give newcomers time to work on them without feeling rushed. As long as you keep us informed that you are still working on this, you can take as long as you need to.

We wish you a speedy recovery!

@mk722
Copy link

mk722 commented Nov 6, 2022

Hello, I just want to let you know that I am still working on this issue, I just have a more difficult course of covid, so it will take a while.
Thank you for understanding.

@uFarad
Copy link
Contributor

uFarad commented Apr 4, 2024

Please see PR #413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new features or improvements good first issue something that would be simple for a newcomer to stumpless to work on help wanted external contributations encouraged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants