import os
import sys
# WARNING:
# We do our best effort to keep sensible information private
# but in the scenario of an intrusion into the network or machines
# where agents or servers that represents a risk for the information
# stored in that machines.

# Main settings
PROJECTID = "{{ data.projectid }}"
PROJECT_NAME = "{{ data.project_name }}"

WORKFLOW_SERVICE = os.getenv("NB_WORKFLOW_SERVICE", "http://localhost:8000")

# Theese information is used to run workloads in the workers.
# Don't modify at least you know what you are doing.
# Log
LOGLEVEL = "INFO"
LOGCONFIG = dict(  # no cov
    version=1,
    disable_existing_loggers=False,
    loggers={
        "nbwork.client": {"level": LOGLEVEL, "handlers": ["console", "error_console"]},
    },
    handlers={
        "console": {
            "class": "logging.StreamHandler",
            "formatter": "generic",
            "stream": sys.stdout,
        },
        "error_console": {
            "class": "logging.StreamHandler",
            "formatter": "generic",
            "stream": sys.stderr,
        },
    },
    formatters={
        "generic": {
            "format": "%(asctime)s [%(process)d] [%(levelname)s] %(message)s",
            "datefmt": "[%Y-%m-%d %H:%M:%S %z]",
            "class": "logging.Formatter",
        },
    },
)