'Configure logging of node\'s log file and stdout/stderr
@return: stdout log file name, stderr log file
name. Values are None if stdout/stderr are not logged.
@rtype: str, str'

def _configure_logging(self):

    log_dir = rospkg.get_log_dir(env=os.environ)
    if self.run_id:
        log_dir = os.path.join(log_dir, self.run_id)
    if (not os.path.exists(log_dir)):
        try:
            os.makedirs(log_dir)
        except OSError as e:
            if (e.errno == 13):
                raise RLException(('unable    to    create    directory    for    log    file    [%s].\nPlease    check    permissions.' % log_dir))
            else:
                raise RLException(('unable    to    create    directory    for    log    file    [%s]:    %s' % (log_dir, e.strerror)))
    self.log_dir = log_dir
    logfileout = logfileerr = None
    if self.log_output:
        (outf, errf) = [os.path.join(log_dir, ('%s-%s.log' % (self.name, n))) for n in ['stdout', 'stderr']]
        if self.respawn:
            mode = 'a'
        else:
            mode = 'w'
        logfileout = open(outf, mode)
        if is_child_mode():
            logfileerr = open(errf, mode)
    node_log_file = log_dir
    if self.is_node:
        self.args = _cleanup_remappings(self.args, '__log:=')
        self.args.append(('__log:=%s' % os.path.join(log_dir, ('%s.log' % self.name))))
    return (logfileout, logfileerr)
