-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support logger without variable argument list #276
base: master
Are you sure you want to change the base?
Conversation
Hi @jserv,
I just follow the style of naming of chewing_new2.
Actually I don't know how to select a meaningful name for chewing_set_logger2, because it may be too long.
Do you think a name like chewing_set_logger_without_varglist is proper?
|
Cc. @czchen The functionality of |
@@ -545,7 +545,7 @@ CHEWING_API int chewing_get_phoneSeqLen(const ChewingContext *ctx); | |||
CHEWING_API void chewing_set_logger(ChewingContext *ctx, | |||
void (*logger) (void *data, int level, const char *fmt, ...), void *data); | |||
|
|||
CHEWING_API void chewing_set_logger2(ChewingContext *ctx, | |||
CHEWING_API void chewing_set_logger_without_varglist(ChewingContext *ctx, |
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.
The suffix without_varglist
is too long. I would expected to revise the use of API instead.
How about using Swig to resolve the convention? |
Can you rebase for reviewing? |
Data4NoVarArgListLogger keeps the real logger and data obtained from the caller. Logger4NoVarArgList collects message properly and forwards it to the real logger.
4ba342c
to
016873b
Compare
libchewing only accepts logger callback with variable argument list so far. However, it seems difficult to implement such callback using other language (eg. Python). This prevents direct access of log messages. Here, the PR implements a new built-in logger and a new API to remove the restriction.