def METHOD_NAME(self, cell, variable):
    if hasattr(cell, 'recordable') and variable in cell.recordable:
        hoc_var = cell.recordable[variable]
    elif variable == 'v':
        hoc_var = cell.source_section(0.5)._ref_v  # or use "seg.v"?
    elif variable == 'gsyn_exc':
        hoc_var = cell.esyn._ref_g
    elif variable == 'gsyn_inh':
        hoc_var = cell.isyn._ref_g
    else:
        source, var_name = self._resolve_variable(cell, variable)
        if hasattr(self.population.celltype, "variable_map"):
            var_name = self.population.celltype.variable_map[variable]
        hoc_var = getattr(source, "_ref_%s" % var_name)
    cell.traces[variable] = vec = h.Vector()
    if self.sampling_interval == self._simulator.state.dt or self.record_times:
        vec.record(hoc_var)
    else:
        vec.record(hoc_var, self.sampling_interval)
    if not cell.recording_time:
        cell.recorded_times = h.Vector()
        if self.sampling_interval == self._simulator.state.dt or self.record_times:
            cell.recorded_times.record(h._ref_t)
        else:
            cell.recorded_times.record(h._ref_t, self.sampling_interval)
        cell.recording_time += 1