@SuppressWarnings("unchecked")
    @Override
    public <T extends Serializable> DiagnosisChannel<T> channel(Class<? extends DiagnosisChannelID<T>> channel,
                                                                ChannelOption... options) {
        // In case we are disabled, return a dummy
        if (this.isDisabled) {
            final DiagnosisChannel<?> impl = new DiagnosisChannelDummyImpl(this, channel);
            return (DiagnosisChannel<T>) impl;
        }

        // In case this was the first call, create a serializer
        synchronized (this) {
            try {
                if (this.serializer == null) {
                    this.serializer = new LogFileWriter(this.recordingFile, this.compressOutput);
                }
            } catch (Exception e) {
                // In case something goes wrong, return a dummy
                e.printStackTrace();
                final DiagnosisChannel<?> impl = new DiagnosisChannelDummyImpl(this, channel);
                return (DiagnosisChannel<T>) impl;
            }
        }

        final DiagnosisChannel<?> impl = new DiagnosisChannelImpl(this, channel);
        return (DiagnosisChannel<T>) impl;
    }