def add_hook_log(node, github, action, path, date, committer, include_urls=False, sha=None, save=False):
 github_data = {'user': github.user, 'repo': github.repo}
 urls = {}
 if include_urls:
  url = node.web_url_for('addon_view_or_download_file', path=path, provider=SHORT_NAME)
  urls = {'view': '{0}?ref={1}'.format(url, sha), 'download': '{0}?action=download&ref={1}'.format(url, sha)}
 node.add_log(action=action, params={'project': node.parent_id, 'node': node._id, 'path': path, 'github': github_data, 'urls': urls}, auth=None, foreign_user=committer, log_date=date, save=save)

def add_hook_log ( node , github , action , path , date , committer , include_urls = False , sha = None , save = False ) : github_data = { 'user' : github . user , 'repo' : github . repo } urls = { } if include_urls : url = node . web_url_for ( 'addon_view_or_download_file' , path = path , provider = SHORT_NAME ) urls = { 'view' : '{0}?ref={1}' . format ( url , sha ) , 'download' : '{0}?action=download&ref={1}' . format ( url , sha ) } node . add_log ( action = action , params = { 'project' : node . parent_id , 'node' : node . _id , 'path' : path , 'github' : github_data , 'urls' : urls } , auth = None , foreign_user = committer , log_date = date , save = save )
add log event for commit from webhook payload .