Coder Social home page Coder Social logo

Comments (6)

halx99 avatar halx99 commented on August 13, 2024 1
#    define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)

they are present only for compatibility purpose, and DEPRECATED.

relative PR: #2017

from axmol.

smilediver avatar smilediver commented on August 13, 2024

I think logging should be removed in release builds by default with an optional opt-in. One way would be to add AX_USE_LOGGING CMake option and something like:

#if !defined(AX_USE_LOGGING)
    #if _AX_DEBUG > 0
        #define AX_USE_LOGGING 1
    #endif
#endif

Ignoring the default values I recommend using enabling logic like AX_USE_LOGGING instead of the disabling like AX_STRIP_DEBUG_LOGGING to avoid double negatives.

Btw, it's possible to workaround this by setting custom null logger using setLogOutput()

from axmol.

rh101 avatar rh101 commented on August 13, 2024

Btw, it's possible to workaround this by setting custom null logger using setLogOutput()

That won't work in this case, since we still need output from AXLOGI/AXOGW/AXLOGE in release builds (depending on the output level set), and I don't want the debug logging calls to remain in the output executable.

I'll sort out a PR for this in the next few days.

from axmol.

smilediver avatar smilediver commented on August 13, 2024

Ah, I missed that you're talking specifically about debug and verbose levels only...

Btw, just found that there are more of these:

#    define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)

Is there a reason why they don't use AXLOG_WITH_LEVEL()? And now they are inconsistent with AXLOGX() macros in respect of what gets enabled for debug/release builds.

from axmol.

rh101 avatar rh101 commented on August 13, 2024

Is there a reason why they don't use AXLOG_WITH_LEVEL()? And now they are inconsistent with AXLOGX() macros in respect of what gets enabled for debug/release builds.

I don't know why they were left in there as they are, but perhaps @halx99 can provide an answer to that question.

from axmol.

halx99 avatar halx99 commented on August 13, 2024
#    define AXLOG(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGERROR(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGINFO(format, ...) ax::print(format, ##__VA_ARGS__)
#    define AXLOGWARN(...) __AXLOGWITHFUNCTION(__VA_ARGS__)

they are present only for compatibility purpose, and DEPRECATED.

from axmol.

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.