Closed Bug 795126 Opened 13 years ago Closed 13 years ago

Make iostream-based debugging DEBUG-only (signaling, mtransport)

Categories

(Core :: WebRTC, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jesup, Assigned: ehugg)

Details

(Whiteboard: [WebRTC], [blocking-webrtc+] [qa-])

Attachments

(1 file, 1 obsolete file)

[17:25] bsmedberg jesup: iostream has caused linkage issues in the past, but I forget why. I don't think we should be using it in production environments without more thought, but for logging-debugging code I think the rule can be "if it works on try it's ok" [17:25] bsmedberg jesup: the problems would be dealing with code that threw exceptions on IO failure, mainly We should look to make them disappear on production, and debugs needed on production move to avoid iostreams. This assumes they don't do that already for all the cases.
Whiteboard: [WebRTC], [blocking-webrtc+]
In the signaling code CSFLogDebugS and CSFLogErrorS are the main things that use streams. They could be replaced by their printf-style equivalents without the trailing S. The stream versions were created because they were considered safer than the printf-style ones.
Attachment #668537 - Attachment is obsolete: true
Comment on attachment 668542 [details] [diff] [review] Remove io streams in Signaling code for non-debug builds All usages of stream should be removed now from signaling unless DEBUG is defined.
Attachment #668542 - Flags: feedback?(ekr)
Comment on attachment 668542 [details] [diff] [review] Remove io streams in Signaling code for non-debug builds Review of attachment 668542 [details] [diff] [review]: ----------------------------------------------------------------- lgtm ::: media/webrtc/signaling/src/common/browser_logging/CSFLogStream.h @@ +55,5 @@ > #define CSFLogDebugS(tag, message) { std::ostringstream _oss; _oss << message << std::endl; CSFLog( CSF_LOG_DEBUG, __FILE__ , __LINE__ , tag, _oss.str().c_str()); } > > +#else // DEBUG > + > +#define CSFLogCriticalS(tag, message) I would do {} to keep the syntax the same.
Attachment #668542 - Flags: feedback?(ekr) → feedback+
Comment on attachment 668542 [details] [diff] [review] Remove io streams in Signaling code for non-debug builds Signaling code patch pushed to Alder - https://hg.mozilla.org/projects/alder/rev/b73eec736a65
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Assignee: nobody → ethanhugg
Whiteboard: [WebRTC], [blocking-webrtc+] → [WebRTC], [blocking-webrtc+] [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: