<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def log(duration, message=None, use_last_commit_message=False):
 """ Log time against the current active issue """

    branch = git.branch
    issue = jira.get_issue(branch)
    # Create the comment
    comment = "Working on issue %s" % branch
    if message:
        comment = message
    elif use_last_commit_message:
        comment = git.get_last_commit_message()

    if issue:
        # If the duration is provided use it, otherwise use the elapsed time since the last mark
        duration = jira.get_elapsed_time(issue) if duration == '.' else duration

        if duration:
            # Add the worklog
            jira.add_worklog(issue, timeSpent=duration, adjustEstimate=None, newEstimate=None, reduceBy=None,
                             comment=comment)

            print "Logged %s against issue %s (%s)" % (duration, branch, comment)
        else:
            print "No time logged, less than 0m elapsed."