Freeseer / freeseer

Designed for capturing presentations at conferences. Pre-fill a list of talks to record, record them, and upload them to YouTube with our YouTube Uploader.
http://freeseer.readthedocs.org
GNU General Public License v3.0
215 stars 110 forks source link

Disable logs when using YT uploader? #547

Open dideler opened 10 years ago

dideler commented 10 years ago

Logs are appearing alongside the printed output of the YT uploader, hindering usability.

Are you sure you would like to upload these videos? [Y/n]
2014-04-06 13:54:28,866 (    INFO) apiclient.discovery                     : URL being requested: https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest
2014-04-06 13:54:29,545 (    INFO) apiclient.discovery                     : URL being requested: https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&alt=json&part=snippet%2Cstatus
2014-04-06 13:54:29,546 (    INFO) freeseer.framework.youtube              : Uploading /home/dennis/Videos/TEST-UCOSPM.ogg
The file was successfully uploaded with video id: 1cdVYBk5aoY

Good for developers perhaps, completely unnecessary for users.

cc @MadMub

MadMub commented 10 years ago

I was thinking of padding the success message with a line above and below so it sticks out more. Does freeseer not control the logging level for the installed version anyway?

dideler commented 10 years ago

I was thinking of padding the success message with a line above and below so it sticks out more.

Sure, give it a try and see how it looks.

Does freeseer not control the logging level for the installed version anyway?

I don't remember, @zxiiro can probably answer that quicker.

@MadMub to improve readability, we can also indent the list of videos found, that way it's easy to know that it "belongs" to the "Found videos" message at the top.

zxiiro commented 10 years ago

We use python's logger, but I think the uploader shouldn't even hook into the logger. It's unnecessary for a shell application.

zxiiro commented 10 years ago

To be clear the Youtube uploader has no dependencies on Freeseer and it's an independent too, even if it's started from the same CLI script. I think the uploader shouldn't be doing any log calls at all. Just use print statements.

MadMub commented 10 years ago

The logging will then be removed completely, as I was instructed to not make print statements in the API layer, which is why I made the youtube frontend. I assumed for the deployed version of freeseer the logger is turned off. On Apr 6, 2014 8:54 PM, "Thanh Ha" notifications@github.com wrote:

To be clear the Youtube uploader has no dependencies on Freeseer and it's an independent too, even if it's started from the same CLI script. I think the uploader shouldn't be doing any log calls at all. Just use print statements.

Reply to this email directly or view it on GitHubhttps://github.com/Freeseer/freeseer/issues/547#issuecomment-39688887 .

zxiiro commented 10 years ago

No we don't do anything special with the deployed version. The logger used to be configurable then some people on the project decided allowing the user to configure the logger was too confusing so we removed that completely.

Logging is hard coded in this file [1].

[1] https://github.com/Freeseer/freeseer/blob/master/src/freeseer/__init__.py

zxiiro commented 10 years ago

Where does the logging get called for the uploader?

I don't see anywhere that we actually set it. Is this from an unmerged PR?

zxiiro commented 10 years ago

The apiclient.discovery log does not come from us. We can surpress it with a call to logging.getLogger("apiclient").setLevel(logging.INFO)

set logging.INFO to something that disables the log, I forget off the top of my head.

EDIT: Actually a better way is this:

logger = logging.getLogger('apiclient.discovery')
logger.propagate = False

EDIT2: You can leave logging in for debug purposes and disable it in the same way as my previous edit.

zxiiro commented 10 years ago

@MadMub Regarding print strings in the API layer, that's right you shouldn't be printing in the API layer. The API could pass messages back to it's caller though and let the caller decide what to do with it.