Open paramhanji opened 8 years ago
The implementation can be done with more care, doesn't seem to be correct.
@catchchaos thanks for starting this; as @abheekg comments, there are some details to fix.
In general, make sure tests run on your machine (make tests && ./tests
) and see and fix Travis' errors.
typedef int (*sd_log_msg_fp)(const char *fmt, ...);
can be used instead of printf_t
@catchchaos the target for the log messages is currently defined in sddekit_api.h
, but this type signature should change to just taking a string so that the log handler doesn't have to do formatting.
Do what you can, ask more questions if you like and I'll also fetch your branch and revise it.
@abheekg Oops I forgot ensure that stdarg was included. Thanks and let me know what else I could do.
@maedoc Sure next time I'll make sure I run the tests first. Sorry for this. I'll make the changes as soon as I can.
@catchchaos @abheekg no rush I won't have time to review today
I wasn't sure how to invoke the logger. @abheek I meant to put in a comment for the same, but I forgot @maedoc Should the file be extended to include getters and setters for the verbose and quiet flags as well? I noticed that sd_log.c has this functionality.
@catchchaos I had in mind just adding to sd_log.c
not replacing it. This is not a well-documented part so try to follow the details I mentioned in #88 and otherwise ask questions, push new commits so we can see where you are.
@maedoc I implemented everything that you described in issue #88. sd_log.c compiles fine on its own. However, make says there's an error in the file. Can I make a pr? I'm not sure why the make error is occuring. The error code is 1 indicating that the file needs to be rebuilt.
Can you commit your changes and push to this PR please?
I commited the changes yesterday. Have a look when you can :)
I've added a function a replace existing typedef as mentioned in issue #88. Kindly review it and tell me if any changes need to be made.