dartsim / dart

DART: Dynamic Animation and Robotics Toolkit
http://dartsim.github.io/
BSD 2-Clause "Simplified" License
901 stars 286 forks source link

Make logging redirectable #279

Open jslee02 opened 9 years ago

jslee02 commented 9 years ago

It would be useful if DART has logger that can print logs to files or console.

mxgrey commented 9 years ago

I think the dumb and easy thing to do is just keep streaming to cout and cerr and trust the user to redirect those streams if they want them redirected to a file. It's hard to think of another solution that doesn't involve either:

(1) Global extern variables for the logger objects, which would be hideous and terrible because global extern variables are hideous and terrible.

(2) Attaching logger object instances to every single DART object, which would be gross and unmanageable, because you'd have to redirect the logger of each object individually, or decide on some master/slave scheme that would probably be difficult to hash out.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.