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

adapter to harmonyos for xlog #1224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qingkouwei
Copy link

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得add_definitions(-DOHOS)放到编译脚本中更好,不要每个CMakeLists.txt都加一遍

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好建议

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__BEGIN_EXTERN_C/__END_EXTERN_C应该是定义在sys/cdefs.h中的,如果目前鸿蒙没有提供相应的头文件的话,我认为应该在项目中新加一个sys/cdefs.h,而不是把__BEGIN_EXTERN_C定义到现有的项目文件中。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在鸿蒙还不稳定,稳定版本里面有sys/cdefs.h

@JalanChao
Copy link

请问mars\comm\unix\thread\thread.h 的 375行为什么要注释掉return pthread_cancel(tid());我看了一下是因为华为的那个pthread.h没有提供pthread_cancel吗?感觉这样直接注了是不是不太稳

@xfz211811
Copy link

各位大神 我用这个pr编译出来的鸿蒙版xlog 日志文件解码报错
[F]decode_log_file.py decompress err, Error -3 while decompressing: invalid stored block lengths

我没有加密 也没有多进程使用 谁知道这是为什么啊

我是直接在C++端操作的xlog代码如下:

  配置xlog
    mars::xlog::XLogConfig config;
    config.mode_ = mars::xlog::kAppenderAsync;
    config.logdir_ = rootPath;
    config.compress_mode_ = mars::xlog::kZlib;
    config.compress_level_ = 0;
    config.cachedir_ = "";
    config.cache_days_ = 0;
    config.nameprefix_ = "xxxx";
    xlogger_SetLevel(kLevelDebug);
    appender_open(config);

写日志
struct timeval timeval;
timeval.tv_sec = 12312332423;
timeval.tv_usec = 123123131;

XLoggerInfo info_;
info_.level = kLevelInfo;
info_.tag = "aaa|ggg";
info_.filename = "";
info_.func_name = "";
info_.line = 123;
info_.timeval = timeval;
info_.tid = 0;
info_.maintid = 0;
info_.pid = 0;

xlogger_Write(&info_,"sdfsfsdf");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants