# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import socorro.lib.ConfigurationManager as cm
import datetime
import re

try:
  from config.commonconfig import database_hostname
  from config.commonconfig import database_name
  from config.commonconfig import database_username
  from config.commonconfig import database_password
except ImportError:
  from commonconfig import database_hostname
  from commonconfig import database_name
  from commonconfig import database_username
  from commonconfig import database_password

from socorro.lib.datetimeutil import utc_now

day = cm.Option()
day.doc = 'the date to dump (YYYY-MM-DD)'
day.default = utc_now().date()
day.fromStringConverter = cm.dateTimeConverter

outputPath = cm.Option()
outputPath.doc = "file system location to put the 'internal/private' output csv file"
outputPath.default = '.'

publicOutputPath = cm.Option()
publicOutputPath.doc = "file system location to put the 'external/public' output csv file"
publicOutputPath.default = '.'

product = cm.Option()
product.doc = 'a comma delimited list of the products to track (leave blank for all)'
product.default = 'Firefox'

version = cm.Option()
version.doc = 'a comma delimited list of the versions to track (leave blank for all)'
version.default = ''

#-------------------------------------------------------------------------------
# Logging

syslogHost = cm.Option()
syslogHost.doc = 'syslog hostname'
syslogHost.default = 'localhost'

syslogPort = cm.Option()
syslogPort.doc = 'syslog port'
syslogPort.default = 514

syslogFacilityString = cm.Option()
syslogFacilityString.doc = 'syslog facility string ("user", "local0", etc)'
syslogFacilityString.default = 'user'

syslogLineFormatString = cm.Option()
syslogLineFormatString.doc = 'python logging system format for syslog entries'
syslogLineFormatString.default = 'Socorro Daily URL (pid %(process)d): %(asctime)s %(levelname)s - %(threadName)s - %(message)s'

syslogErrorLoggingLevel = cm.Option()
syslogErrorLoggingLevel.doc = 'logging level for the log file (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)'
syslogErrorLoggingLevel.default = 10

stderrLineFormatString = cm.Option()
stderrLineFormatString.doc = 'python logging system format for logging to stderr'
stderrLineFormatString.default = '%(asctime)s %(levelname)s - %(message)s'

stderrErrorLoggingLevel = cm.Option()
stderrErrorLoggingLevel.doc = 'logging level for the logging to stderr (10 - DEBUG, 20 - INFO, 30 - WARNING, 40 - ERROR, 50 - CRITICAL)'
stderrErrorLoggingLevel.default = 10

