Code Monkey home page Code Monkey logo

Comments (8)

sharkdp avatar sharkdp commented on May 24, 2024

This is not a logging library.

What exactly do you mean by "android support"?

from dbg-macro.

gggin avatar gggin commented on May 24, 2024

if you made a choice for no android support , you should provider a interface for replace std::err << to something else to support android output interface so I can write my own __android_log_print wrapper. Without change you original source code.

something like this:
https://stackoverflow.com/questions/12152555/how-to-print-log-in-android-c-file

from dbg-macro.

gggin avatar gggin commented on May 24, 2024

@xorz57 cpp library should be run on any platform that support c++, If cannot or featureless, maybe provide something extension to extend the library.I already change std::err to my own logging library for usage. It's easy for me, maybe not for others.

from dbg-macro.

sharkdp avatar sharkdp commented on May 24, 2024

@gggin If I understand you correctly, you would like to use the core-functionality of this library without having to rely on std::cerr to be availble? Sounds like a reasonable request for me.

from dbg-macro.

gggin avatar gggin commented on May 24, 2024

Yes. @sharkdp maybe Template specialization, or a setter for a lambda or otherthings。

from dbg-macro.

ShikChen avatar ShikChen commented on May 24, 2024

FWIW, the similar libs in Go and Python also logs to /tmp/q so it's easier to inspect on complex systems. It's useful when the program

  1. logs to some file and does not have stderr, or
  2. already have too much logs in stderr

It's more like a choice about how quick-and-dirty dbg-macro would like to be though.

from dbg-macro.

sharkdp avatar sharkdp commented on May 24, 2024

similar libs in Go and Python also logs to /tmp/q so it's easier to inspect on complex systems

That's actually a pretty cool idea! Should be in a separate ticket, maybe?

from dbg-macro.

sharkdp avatar sharkdp commented on May 24, 2024

As for /tmp/q, I think that would work fine as long as you are running just a single process that writes to /tmp/q. As soon as multiple programs are running ("complex systems", as stated in your comment), that would not work at all. So we would probably have to add the PID and write to /tmp/q.$PID or similar. That immediately makes this less useful.

As for writing to something else then std::cerr: I would like to avoid adding more configuration options for now. I'm trying to design this library such that users only #include <dbg.h> and then immediately start putting dbg(…) in their code. Without any other compile- or runtime configuration.

from dbg-macro.

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.