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

priority to string function #450

Closed
goatshriek opened this issue Sep 28, 2024 · 7 comments
Closed

priority to string function #450

goatshriek opened this issue Sep 28, 2024 · 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

A function exists to get the string representation of a prival, stumpless_get_prival_string, which returns a string version of the two enumerations used to create the prival. However, this is longer and more verbose than need be, and a more succinct representation would follow the priority string convention used by tools like logger, for example local3.info. You will write a second function that generates this shorter form string for a prival.

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.

Review the existing implementation of stumpless_get_prival_string in src/prival.c. Once you understand how the current implementation works, start adding the new functionality to the same file and the associated header, in a function named stumpless_get_priority_string.

Note that stumpless_prival_from_string accepts strings in the same format of facility.severity. You can reference this implementation for ideas on how to implement the new function.

Add tests for your new functionality in the existing test module test/function/prival.cpp, based on the tests already there.

@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 hacktoberfest labels Sep 28, 2024
@KlowdfurrRad
Copy link

Hi,
I would like to work on this. This would be my first contribution. My background is mostly C++ and some C.

@goatshriek
Copy link
Owner Author

There is already PR #457 open to resolve this issue. Are there any other issues in the repository that you are interested in? There may be some more to string function implementation issues added in the next week or so as well.

@KlowdfurrRad
Copy link

KlowdfurrRad commented Oct 7, 2024

Oh okay. Can I work on param into string function in that case?
This one seems to not be assigned. But if someone is working on it I am interested in trying entry to string as well.

@goatshriek
Copy link
Owner Author

Either of those should be fine! Whichever you would like can be assigned, just drop a comment on the issue you'd like (not here).

@m3g4d1v3r
Copy link
Contributor

m3g4d1v3r commented Nov 6, 2024

Hello @KlowdfurrRad and @goatshriek.
Can I co-author PR #457? If you don't mind, I can make some commits after the old ones in order to let the PR pass the tests.

@goatshriek
Copy link
Owner Author

With no response from the original author, I think you're safe to bring it across the finish line. Abandoned PRs are not uncommon, particularly around Hacktoberfest.

@goatshriek
Copy link
Owner Author

Resolved by #476.

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

No branches or pull requests

3 participants