Merge lp://staging/~phablet-team/media-hub/add-logger into lp://staging/media-hub

Proposed by Jim Hodapp
Status: Superseded
Proposed branch: lp://staging/~phablet-team/media-hub/add-logger
Merge into: lp://staging/media-hub
Diff against target: 2780 lines (+819/-331)
32 files modified
CMakeLists.txt (+1/-1)
debian/bileto_pre_release_hook (+21/-52)
debian/control (+6/-6)
debian/control.in (+1/-0)
debian/get-versions.sh (+5/-3)
debian/rules (+1/-1)
include/core/media/player.h (+23/-0)
src/core/media/CMakeLists.txt (+9/-0)
src/core/media/apparmor/ubuntu.cpp (+7/-6)
src/core/media/audio/pulse_audio_output_observer.cpp (+10/-8)
src/core/media/gstreamer/engine.cpp (+30/-29)
src/core/media/gstreamer/playbin.cpp (+39/-46)
src/core/media/logger/logger.cpp (+161/-0)
src/core/media/logger/logger.h (+131/-0)
src/core/media/non_copyable.h (+36/-0)
src/core/media/player_implementation.cpp (+39/-38)
src/core/media/player_skeleton.cpp (+6/-4)
src/core/media/player_stub.cpp (+10/-6)
src/core/media/power/state_controller.cpp (+13/-13)
src/core/media/server/server.cpp (+34/-0)
src/core/media/service.cpp (+3/-1)
src/core/media/service_implementation.cpp (+27/-26)
src/core/media/service_skeleton.cpp (+20/-19)
src/core/media/telephony/CMakeLists.txt (+1/-0)
src/core/media/telephony/call_monitor.cpp (+9/-7)
src/core/media/telephony/qtbridge.cpp (+0/-2)
src/core/media/track_list_implementation.cpp (+25/-23)
src/core/media/track_list_skeleton.cpp (+31/-32)
src/core/media/track_list_stub.cpp (+9/-7)
src/core/media/util/utils.cpp (+41/-0)
src/core/media/util/utils.h (+69/-0)
src/core/media/video/platform_default_sink.cpp (+1/-1)
To merge this branch: bzr merge lp://staging/~phablet-team/media-hub/add-logger
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
Konrad Zapałowicz (community) code Approve
Review via email: mp+291010@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2016-04-06.

Commit message

Add a proper logger to media-hub that includes traces, timestamps and other conveniences and no longer rely on cout/cerr.

Description of the change

Add a proper logger to media-hub that includes traces, timestamps and other conveniences and no longer rely on cout/cerr.

To post a comment you must log in.
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

Not many issues compared to the length of the diff and frankly I'm mostly concerned about the own noncopyable class.

There is also one thing which is not bad however I would like to highlight it. I did not like the need to create stringstream in so many cases to log a line as basically this is repeating.

review: Needs Fixing (code)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

I have some concerns with this MP:

* I do not really like moving to the printf way of doing things. Why should be drop type safeness? It would be better to use the boost logger more "natively" with "<<" operators, changing the wrapper class to something similar to what Qt does (qDebug() << message, etc.). Even more, using printf way in the end we need to resort to using stringstream in several places where it was not needed before.

* I still see cout and cerr being used in many places. But please do not change that yet until we have an agreement on how the class Logger should be used.

* I do not think we should introduce functions in the Utils namespace that we do not use. Specially taking into account that I would prefer to avoid using the only one that seems to be used, Sprintf :)

* Line sizes in new files are > 100 in many cases

There are also a couple of inline comments.

review: Needs Fixing
Revision history for this message
Jim Hodapp (jhodapp) wrote :

> Not many issues compared to the length of the diff and frankly I'm mostly
> concerned about the own noncopyable class.

I am using this same logger which comes from aethercast. It relies on it's own noncopyable class, so just maintaing consistency. Really, this logger should be brought into a standard library for everyone to use, but that's out of the scope of this story.

>
> There is also one thing which is not bad however I would like to highlight it.
> I did not like the need to create stringstream in so many cases to log a line
> as basically this is repeating.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

> I have some concerns with this MP:
>
> * I do not really like moving to the printf way of doing things. Why should be
> drop type safeness? It would be better to use the boost logger more "natively"
> with "<<" operators, changing the wrapper class to something similar to what
> Qt does (qDebug() << message, etc.). Even more, using printf way in the end we
> need to resort to using stringstream in several places where it was not needed
> before.

Boost still maintains complete type safety with using the printf style. See the Boost::Log docs about this if you have any questions. This private Boost::Log interface implementation comes from tvoss and we're starting to standardize on it. Not sure why it doesn't use streams but that's outside anything I can really control without rewriting the private logger interface.

>
> * I still see cout and cerr being used in many places. But please do not
> change that yet until we have an agreement on how the class Logger should be
> used.

There are some that will need to remain, but otherwise I've made sure that all superfluous ones have now been removed.

>
> * I do not think we should introduce functions in the Utils namespace that we
> do not use. Specially taking into account that I would prefer to avoid using
> the only one that seems to be used, Sprintf :)

Fixed

>
> * Line sizes in new files are > 100 in many cases

I tried not to do that, any specific ones?

>
> There are also a couple of inline comments.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

Replied/addressed inline comments.

Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

Thanks for fixes & explanations, ack.

review: Approve (code)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Thanks for the changes. LGTM, although I do not agree with how the Logger is designed. As discussed, we need to rethink it and come back to this when we do so.

review: Approve
194. By Jim Hodapp

Merged with prereq to get this to build in a silo until silo 51 lands

195. By Jim Hodapp

Make sure everything is licensed under LGPL v3

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: