I am using GNU Radio's logging functionality in some custom python blocks I've built for a flowgraph.  Among other things, the logging methods are useful for recording the (rough) start time of the flowgraph to a log file.  I would also like to record the end time of the flowgraph (i.e., the rough time I kill the flowgraph in companion) in a log message written to the log file.  To be clear, I'm looking for a solution that will work when I run the flowgraph from GNU Radio Companion.  Is there an easy way to do this?
In GNU Radio blocks, you can overload the stop method to do exactly that, execute code at flow graph stop time.
Generally, the "stop" button in GRC is a rather hardcore thing; if you instead have a finishing condition in your flowgraph itself (e.g. closing of the window if you're using Qt GUI, or finishing of any block), this could be approached from that logical "I should be done" point of view, rather than "someone else tries to kill me".
GNU Radio Companion -- logging a message just prior to flowgraph shutdown