<commit_before>americano = require 'americano'
printit = require 'printit'
RealtimeAdapter = require 'cozy-realtime-adapter'

initKonnectors = require './server/init/konnectors'

log = printit
    prefix: null
    date: true

process.env.TZ = 'UTC'

params =
    name: 'konnectors'
    port: process.env.PORT || 9358

americano.start params, (app, server) ->
    realtime = RealtimeAdapter server: server, ['konnector.update']

    initKonnectors (err) ->
        if err
            log.error "An error occured."
            log.error "Konnectors were not properly initialized."
        else
            log.info "all konnectors are created."
<commit_msg>add error logging<commit_after>americano = require 'americano'
printit = require 'printit'
RealtimeAdapter = require 'cozy-realtime-adapter'

initKonnectors = require './server/init/konnectors'

log = printit
    prefix: null
    date: true

process.env.TZ = 'UTC'

params =
    name: 'konnectors'
    port: process.env.PORT || 9358

americano.start params, (app, server) ->
    realtime = RealtimeAdapter server: server, ['konnector.update']

    initKonnectors (err) ->
        if err
            log.raw err
            log.error "An error occured."
            log.error "Konnectors were not properly initialized."
        else
            log.info "all konnectors are created."

{'fraction_non_alphanumeric': 0.1038863976083707, 'fraction_numerical': 0.005979073243647235, 'mean_word_length': 2.7824858757062145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7339696', 'n_tokens_mistral': 415, 'n_tokens_neox': 404, 'n_words': 114}