Git Product home page Git Product logo

Comments (11)

0x804d8000 avatar 0x804d8000 commented on May 3, 2024

1,应该不会求值,glog里面我记得有判断。如果还是求值了应该是bug。

2,是的,本身是一个针对glog的wrapper,内部有些脚本依赖glog的格式,而且实践中也够用,所以就没有自己搞一套独立的了。blade编译出来改了rpath,比较简单的办法是去build64_xxx/path/to/xxx_test.runfiles下面运行。

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

1,应该不会求值,glog里面我记得有判断。如果还是求值了应该是bug。

2,是的,本身是一个针对glog的wrapper,内部有些脚本依赖glog的格式,而且实践中也够用,所以就没有自己搞一套独立的了。blade编译出来改了rpath,比较简单的办法是去build64_xxx/path/to/xxx_test.runfiles下面运行。

  1. 我尝试过了, 确实是会去执行这个函数, 可以看一下 google/glog#463
    所以我们要不要优化这点
  2. 好的

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

1,应该不会求值,glog里面我记得有判断。如果还是求值了应该是bug。

2,是的,本身是一个针对glog的wrapper,内部有些脚本依赖glog的格式,而且实践中也够用,所以就没有自己搞一套独立的了。blade编译出来改了rpath,比较简单的办法是去build64_xxx/path/to/xxx_test.runfiles下面运行。

glog的LOG(XX)系列是先构造完LOGMessage再去判断的日志等级, VLOG是先判断日志等级再去构造Message

from flare.

0x804d8000 avatar 0x804d8000 commented on May 3, 2024

应该是我记错了(或者内部的魔改过)。

这儿确实值得处理下,不然尤其是debug级别的日志,始终求值对用户不太友好,可能需要删了加加了删。

感觉可以用if (log enabled)套一层之类的。

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

应该是我记错了(或者内部的魔改过)。

这儿确实值得处理下,不然尤其是debug级别的日志,始终求值对用户不太友好,可能需要删了加加了删。

感觉可以用if (log enabled)套一层之类的。

感觉

#define FLARE_LOG_INFO(...)                                              \
  if (GLOG_INFO >= GFLAGS_minloglevel)
    LOG(INFO) << ::flare::internal::logging::FormatLog(__FILE__, __LINE__, \
                                                       __VA_ARGS__)

或者直接用LOG_IF也可以

#define FLARE_LOG_INFO(...)                                              \
  LOG_IF(INFO, GLOG_INFO >= GFLAGS_minloglevel) 
                 << ::flare::internal::logging::FormatLog(__FILE__, __LINE__, \
                                                     __VA_ARGS__)

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

应该是我记错了(或者内部的魔改过)。

这儿确实值得处理下,不然尤其是debug级别的日志,始终求值对用户不太友好,可能需要删了加加了删。

感觉可以用if (log enabled)套一层之类的。

debug级别日志指DLOG()系列吗? 这个倒还好, 如果在Release模式下, DLOG直接展开为空, 不会去求值

from flare.

0x804d8000 avatar 0x804d8000 commented on May 3, 2024

迷糊了,想着还有个LOG_DEBUG这种级别去了……

那现在这样我觉得倒没什么,正常的代码里面INFO/+的日志也不会很多,感觉优化必要不大

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

迷糊了,想着还有个LOG_DEBUG这种级别去了……

那现在这样我觉得倒没什么,正常的代码里面INFO/+的日志也不会很多,感觉优化必要不大

OK

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

2,是的,本身是一个针对glog的wrapper,内部有些脚本依赖glog的格式,而且实践中也够用,所以就没有自己搞一套独立的了。blade编译出来改了rpath,比较简单的办法是去build64_xxx/path/to/xxx_test.runfiles下面运行。

如果我要运行flare/base/internal/logging_test, 要倒flare/base/internal/logging_test.runfiles下面执行../logging_test?
image

from flare.

0x804d8000 avatar 0x804d8000 commented on May 3, 2024

LD_LIBRARY_PATH到.(当前目录)应该可以

from flare.

4kangjc avatar 4kangjc commented on May 3, 2024

LD_LIBRARY_PATH到.(当前目录)应该可以

嗯嗯, 在flare目录下, 也可以export LD_LIBRARY_PATH=./build64_release/flare/base/internal/logging_test.runfiles/去运行./blade-bin/flare/base/internal/logging_test

from flare.

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.