<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _get_logger(self, handler):
        ''' Initialize a PCAP stream for logging data '''
        log_file = self._get_log_file(handler)

        if not os.path.isdir(os.path.dirname(log_file)):
            os.makedirs(os.path.dirname(log_file))

        handler['log_rot_time'] = time.gmtime()
        return pcap.open(log_file, mode='a')