It does sound like a good plan, but in the other PR, you tap into the
logging of four different modules, which is starting to sound like a
complex refactoring job.


On Mon, Dec 16, 2013 at 8:13 PM, Carson Gee <notifications@github.com>wrote:

> In cms/djangoapps/contentstore/views/push_to_lms.py:
>
> > +def push_to_lms(request, org, course, name):
> > +    """
> > +    This method serves up the 'Push to LMS' page
> > +    """
> > +    location = Location('i4x', org, course, 'course', name)
> > +    if not has_access(request.user, location):
> > +        raise PermissionDenied()
> > +    course_module = modulestore().get_item(location)
> > +    failed = False
> > +
> > +    log.debug('push_to_lms course_module=%s', course_module)
> > +
> > +    msg = ""
> > +    if 'action' in request.GET and course_module.giturl:
> > +        # Hijack the logger to display helpful information to the user and do the push
> > +        output = StringIO.StringIO()
>
> Good point. The other bit that isn't thread safe is setting the level
> since that is set on the module logger one may be setting it back to INFO
> or whatever is set in settings. That could result in less info in one, or
> the logging level getting stuck at debug after running a while if a second
> thread sees the original level as Debug. Whoops. I'll fix it here and the
> other places it is used. I'll just modify the export and import functions
> everywhere I want to get logs from to accept loggers that default to the
> module logger. That sound like a good plan?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/718/files#r8389557>
> .
>