# -*- mode: conf; coding: utf-8 -*-
# :Project:   SoL -- Development configuration
# :Created:   sab 27 set 2008 10:57:57 CET
# :Author:    Lele Gaifax <lele@metapensiero.it>
# :License:   GNU General Public License version 3 or later
# :Copyright: © 2008, 2009, 2010, 2013, 2014, 2016, 2018, 2020 Lele Gaifax
#

[app:main]
use = egg:sol

desktop.title = SoL
desktop.version = dev
desktop.debug = true
desktop.domain = sol-client
desktop.manifest = %(here)s/manifest.json

available_languages = it en_GB en_US

mako.directories = sol:views

pyramid.reload_templates = true
pyramid.debug_authorization = false
pyramid.debug_notfound = false
pyramid.debug_routematch = false
pyramid.default_locale_name = en_GB
pyramid.includes =
    pyramid_tm
    pyramid_mailer.debug
    metapensiero.sqlalchemy.proxy.pyramid

session.secret = AmbarabaCiciCoco

sqlalchemy.url = sqlite:///%(here)s/development.db

# Authentication
sol.admin.user = admin
sol.admin.password = admin
sol.admin.email = lele@example.com

sol.guest.user = guest
sol.guest.password = guest

sol.enable_signin = true
sol.enable_password_reset = true
sol.signer_secret_key = AbracaDabra

# For backup/restore manual tests
sol.portraits_dir = %(here)s/portraits
sol.emblems_dir = %(here)s/emblems
sol.backups_dir = /tmp/solbcks

# Alembic

# Path to migration scripts
script_location = alembic

# Template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# Max length of characters to apply to the
# "slug" field
#truncate_slug_length = 40

# Set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6996

###
# logging configuration
# http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/logging.html
###

[loggers]
keys = root, sol, sqlalchemy, ratings, waitress

[handlers]
keys = console, ratings

[formatters]
keys = generic, simple

[logger_root]
level = INFO
handlers = console

[logger_sol]
level = DEBUG
handlers =
qualname = sol

[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
# "level = INFO" logs SQL queries.
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither.  (Recommended for production systems.)

[logger_ratings]
level = DEBUG
handlers = ratings
qualname = sol.models.rating

[logger_waitress]
level = ERROR
handlers =
qualname = waitress.queue

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[handler_ratings]
class = FileHandler
args = ('ratings.log',)
level = INFO
formatter = simple

[formatter_generic]
format = %(asctime)s [%(levelname).1s] %(name)s: %(message)s
datefmt = %H:%M:%S

[formatter_simple]
[%(levelname).1s] %(name)s: %(message)s