Closed zhaozg closed 9 months ago
Sorry, I don't understand why you want to call it twice.
RimeSetupLogging
should only be called once at program start. If called more than once, the program logic could be wrong, and the error is desired.
If you don't intend to call it twice, then please find the root cause, not mute the error.
librime 是我的唯一使用的输入法, 首先表示感谢。
我基于 librime 的 lua 绑定 进行一些单元/功能测试。
已注意到 librime 提供了 initialize/finalize 的接口封装,每个测试用例执行前调用了 initialize
, 执行后调用了 finalize
,
从头文件暴露的接口来看,librime应该支持多次初始化的, 但是 glog 不支持多次初始化,抛出了当前问题中描述的,也没发现glog有类似于 finalize
的接口。
我没有直接调用过RimeSetupLogging
, 而是调用了RimeSetup
, 通过
https://github.com/rime/librime/blob/de12d6ae52ea0439ac689a9469b7041653a19fd5/src/rime_api.cc#L52
可知,SetupLogging
在此处调用了。 RimeSetup
的多次调用导致了该问题。
多次调用RimeSetup
的目的是为单元测试加载不同的配置与数据,写到这里我怀疑是自己的调用不当造成的,RimeSetup
也不应该多次调用,而是通过调用RimeInitialize
来加载不同的配置。
我继续修改下自己的代码,跟踪分析下, 该问题验证后我会关闭掉。
Describe the bug
Multi times call initialize will get error.
https://github.com/zhaozg/rime_lua/actions/runs/7239083738/job/19720573177#step:4:941
To Reproduce Steps to reproduce the bug:
github ci at https://github.com/zhaozg/rime_lua/blob/master/.github/workflows/ci.yml
error output please look at here
Expected behavior Not hit this error report.
Log If applicable, add crash log to quick focus your problem.
Screenshots If applicable, add screenshots to help explain your problem.
Flavor(please complete the following information): Select your flavor:
Package:
Additional context Add any other context about the problem here.