Giter Club home page Giter Club logo

Comments (5)

tianlongqin avatar tianlongqin commented on June 29, 2024

目前EasyLogger的功能并不支持多进程安全,所以如果单纯的写到文件,会有覆盖现象。
当然EasyLogger的架构就是为了方便扩展,达到个人使用的任意要求。如果是linux系统,可以使用system v或者posix的信号量来做到多进程安全。
具体的说,使用信号量在elog_port_init,elog_port_output_lock,pthread_mutex_unlock中替换掉pthread_mutex操作即可。

from easylogger.

tianlongqin avatar tianlongqin commented on June 29, 2024

非常抱歉,pthread_mutex_unlock粘错了,应该是elog_port_output_unlock。

from easylogger.

zuowanbushiwo avatar zuowanbushiwo commented on June 29, 2024

好的,非常谢谢!如果是写到控制台,目前就可以了吗?你们官方会添加这个需求吗?

from easylogger.

tianlongqin avatar tianlongqin commented on June 29, 2024

如果写到控制台就没有多进程的概念了,EasyLogger本身是支持线程安全的。重要查看各平台的elog_port_output函数的定义。
关于写文件的需求,我近期抽时间添加下,到时候推送给作者,如果没问题,应该可以合并到主线上。敬请期待!

from easylogger.

zuowanbushiwo avatar zuowanbushiwo commented on June 29, 2024

感谢!

from easylogger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.