Hi,
Its nothing really different from what is done in rbslack extension
(present in rb-extension-pack repo on github). I followed that as an
example to create the custom extension below which will send updates on
different review request related events.
Code snippets:
import logging
.....
def on_review_published(self, user, review, **kwargs):
"""
Handler to send update for the review_published signal.
This is called when a review is published for a review request.
"""
# Get review request corresponding to this review
review_request = review.review_request
logging.debug("RBExtension: Sending update for " + \
"review_published event: review request pk=%s" % review_request.pk)
....
Thanks,
Abhi
On Friday, February 3, 2017 at 2:49:22 AM UTC+5:30, Christian Hammond wrote:
>
> Hi Abhi,
>
> Can you show me the code for doing the logging? Logging from extensions
> should definitely be going into the reviewboard.log file.
>
> Christian
>
> --
> Christian Hammond
> President/CEO of Beanbag <https://www.beanbaginc.com/>
> Makers of Review Board <https://www.reviewboard.org/>
>
> On Thu, Feb 2, 2017 at 1:45 AM, Abhishek Choudhary <[email protected]
> <javascript:>> wrote:
>
>> Hi,
>>
>> I have written a custom RB extension but debug logs statements are not
>> getting printed in the logs. I am using Apache to run RB. I have enabled
>> debug logs in settings_local in Django configuration and also enabled
>> Server debug logs from Admin UI.
>> I am not having any luck with this. I am using logging module in the
>> extension similar to rbslack extension
>> <https://github.com/reviewboard/rb-extension-pack/tree/9279adf6bd68c58c641641e28f14626d159bcad0/rbslack>
>>
>> Could you please tell me the correct way to enable debug logging for RB
>> server that will enable logs from Extensions as well.
>>
>> Thanks,
>> Abhi
>>
>> --
>> Supercharge your Review Board with Power Pack:
>> https://www.reviewboard.org/powerpack/
>> Want us to host Review Board for you? Check out RBCommons:
>> https://rbcommons.com/
>> Happy user? Let us know! https://www.reviewboard.org/users/
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "reviewboard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
Supercharge your Review Board with Power Pack:
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons:
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.