Dynamic data loading should not use iostream
Opened this issue · 5 comments
Deleted user commented
Originally reported on Google Code with ID 18
Dynamic data loading currently uses iostream for logging.
That would be fine, except that nowhere else in the library is iostream used, meaning
this is bringing in many classes for little gain, and only when dynamic data loading
is turned on.
Reported by csyoung@google.com
on 2014-07-15 21:39:27
Deleted user commented
Fair point. Do you have an alternative in mind? I can think of three:
1. Use printf instead. It's supposed to be much lighter weight.
2. Require a flag during build to create a "debug" version that include this error
logging
3. Both 1 and 2 above.
Thoughts?
Reported by andrewhayden@google.com
on 2014-07-16 10:17:50
Deleted user commented
I've thought a bit more about this and I think what we should do here is add a logging
helper to CLD2, and use that. We can then twiddle the logger on/off based on a DEFINE,
just like many other logging frameworks. I don't want to add a third-party logging
solution because the overhead just isn't worth it for our very sparse usage, at least
not at present.
We can switch to printf for now, and go down the define flag avenue later if it seems
worthwhile. Sound good?
Reported by andrewhayden@google.com
on 2014-07-25 08:10:00
Deleted user commented
Checked in compact_lang_det_impl.cc and found the standard pattern used here, which
is fprintf([stderr|stdout], ...). So that's the way to go.
Reported by andrewhayden@chromium.org
on 2014-07-25 08:42:21
Deleted user commented
Reported by andrewhayden@google.com
on 2014-07-25 08:42:41
- Status changed:
Accepted
Deleted user commented
Committed as r164.
Reported by andrewhayden@google.com
on 2014-07-25 11:48:23
- Status changed:
Fixed