Commit ccfaec6f authored by Linedwell's avatar Linedwell

refactoring suite à création de my logging

parent 1ae9af11
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/admissibilite.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
from pywikibot import pagegenerators
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/adr.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
import time
......
......@@ -11,8 +11,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/bas.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
import time
......
......@@ -11,8 +11,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/disambigWarningUpdater.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import re
import time
......
......@@ -11,8 +11,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/grapher.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/inactive.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import time
from datetime import date, datetime, timedelta
......
......@@ -11,8 +11,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/init.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import time
from datetime import date
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/interviki.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
from pywikibot import pagegenerators
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/massrevert.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
import time
......
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (C) Linedwell, 2016
import os
import __main__ as main
logdir=os.getenv('LOGDIR',os.path.dirname(os.path.realpath(main.__file__))) #Récupération de la variable d'environnement LOGDIR si elle existe, . sinon on se place là où se trouve le script lancé
logname=os.path.splitext(os.path.basename(main.__file__))[0]+'.log' #On récupère le nom du script lancé (python <script.py> et on y appose l'extension .log)
logfile=logdir+os.sep+logname
import logging
logging.basicConfig(filename=logfile, format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
......@@ -12,8 +12,7 @@
import sys, getopt
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/pas.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import re
import time
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/recents.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import re, time
from datetime import date, datetime, timedelta
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/rights-watcher.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
from datetime import datetime
......
......@@ -12,8 +12,7 @@
import sys
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/statut.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import pywikibot
import time
......
......@@ -12,8 +12,7 @@
import sys, getopt
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/viki.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import re, time
......
......@@ -11,8 +11,7 @@
import sys, getopt
sys.path.insert(1, '..') #ajoute au PYTHONPATH le répertoire parent
import logging
logging.basicConfig(filename='log/w3po.log', format='%(asctime)s :: %(levelname)s :: %(message)s', level=logging.INFO)
import mylogging
import cgi
import urllib2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment