<commit_before>package org.jitsi.jibri.sink.impl

import org.jitsi.jibri.sink.Sink
import org.jitsi.jibri.util.extensions.error
import java.io.File
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.logging.Logger

/**
 * [FileSink] represents a sink which will write to a media file on the
 * filesystem
 */
class FileSink(val recordingsDirectory: File, callName: String, extension: String = ".mp4") : Sink {
    private val logger = Logger.getLogger(this::class.qualifiedName)
    val file: File?
    init {
        val currentTime = LocalDateTime.now()
        val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss")
        val filename = callName + currentTime.format(formatter) + extension
        if (recordingsDirectory.mkdirs() or recordingsDirectory.isDirectory) {
            file = File(recordingsDirectory, filename)
            logger.info("Using recording file " + file.toString())<commit_msg>add underscore separator between callname and date in recordings filename<commit_after>package org.jitsi.jibri.sink.impl

import org.jitsi.jibri.sink.Sink
import org.jitsi.jibri.util.extensions.error
import java.io.File
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.logging.Logger

/**
 * [FileSink] represents a sink which will write to a media file on the
 * filesystem
 */
class FileSink(val recordingsDirectory: File, callName: String, extension: String = ".mp4") : Sink {
    private val logger = Logger.getLogger(this::class.qualifiedName)
    val file: File?
    init {
        val currentTime = LocalDateTime.now()
        val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd-HH-mm-ss")
        val filename = "${callName}_${currentTime.format(formatter)}$extension"
        if (recordingsDirectory.mkdirs() or recordingsDirectory.isDirectory) {
            file = File(recordingsDirectory, filename)
            logger.info("Using recording file " + file.toString())
{'fraction_non_alphanumeric': 0.10353535353535354, 'fraction_numerical': 0.00101010101010101, 'mean_word_length': 3.927860696517413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1080910', 'n_tokens_mistral': 574, 'n_tokens_neox': 563, 'n_words': 142}