mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 10:10:33 +05:00
informations de log
This commit is contained in:
parent
13469a2390
commit
8eb3c73cbd
@ -19,18 +19,21 @@
|
|||||||
#
|
#
|
||||||
"""Lancement des cas-tests de blocFissure"""
|
"""Lancement des cas-tests de blocFissure"""
|
||||||
|
|
||||||
import traceback
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
import tempfile
|
||||||
|
import traceback
|
||||||
|
|
||||||
from blocFissure.gmu import initLog
|
from blocFissure.gmu import initLog
|
||||||
from blocFissure.gmu.casStandard import casStandard
|
from blocFissure.gmu.casStandard import casStandard
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------------
|
||||||
#initLog.setDebug()
|
LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
|
||||||
#initLog.setVerbose()
|
#initLog.setDebug(LOGFILE) # debug = 10
|
||||||
#initLog.setRelease()
|
initLog.setVerbose(LOGFILE) # info = 20
|
||||||
#initLog.setPerfTests()
|
#initLog.setRelease(LOGFILE) # warning = 30
|
||||||
|
#initLog.setPerfTests(LOGFILE) # critical = 50
|
||||||
|
#initLog.setAlways(LOGFILE) # critical = 50
|
||||||
|
|
||||||
# ---tous les cas en séquence, ou les cas sélectionnés ...
|
# ---tous les cas en séquence, ou les cas sélectionnés ...
|
||||||
TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] # OK
|
TORUNOK = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0] # OK
|
||||||
@ -238,6 +241,7 @@ def calcul_cas (n_cas, cas, d_aux, ligne):
|
|||||||
nom = cas.nomProbleme
|
nom = cas.nomProbleme
|
||||||
texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom)
|
texte_a = "\n=== Exécution du cas n° {}, '{}'".format(n_cas,nom)
|
||||||
logging.critical(ligne+texte_a)
|
logging.critical(ligne+texte_a)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ok_maillage = cas.executeProbleme()
|
ok_maillage = cas.executeProbleme()
|
||||||
except:
|
except:
|
||||||
@ -246,6 +250,7 @@ def calcul_cas (n_cas, cas, d_aux, ligne):
|
|||||||
if not ok_maillage:
|
if not ok_maillage:
|
||||||
texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
|
texte = "Problème avec le cas n° {}, '{}'\n".format(n_cas,nom)
|
||||||
print(ligne)
|
print(ligne)
|
||||||
|
|
||||||
return ok_maillage, texte
|
return ok_maillage, texte
|
||||||
#=============================================================
|
#=============================================================
|
||||||
def calcul_tout (l_problemes, d_aux):
|
def calcul_tout (l_problemes, d_aux):
|
||||||
|
@ -34,12 +34,14 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
|
|
||||||
for n_edges, edges in enumerate(listEdges):
|
for n_edges, edges in enumerate(listEdges):
|
||||||
|
|
||||||
idf = idFacesDebouchantes[n_edges] # indice de face débouchante (facesPipePeau)
|
# idf = indice de face débouchante (facesPipePeau) ; idf vaut 0 ou 1
|
||||||
|
idf = idFacesDebouchantes[n_edges]
|
||||||
logging.info("idf: %d", idf)
|
logging.info("idf: %d", idf)
|
||||||
if idf >= 0:
|
if ( idf >= 0 ):
|
||||||
gptdsk = list()
|
gptdsk = list()
|
||||||
if idf > 0: # idf vaut 0 ou 1
|
# si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
|
||||||
idf = -1 # si idf vaut 1, on prend le dernier élément de la liste (1 ou 2 extrémités débouchent sur la face)
|
if ( idf > 0 ):
|
||||||
|
idf = -1
|
||||||
centre = ptEdgeFond[idFillingFromBout[n_edges]][idf]
|
centre = ptEdgeFond[idFillingFromBout[n_edges]][idf]
|
||||||
name = "centre_{}".format(idf)
|
name = "centre_{}".format(idf)
|
||||||
geomPublish(initLog.debug, centre, name)
|
geomPublish(initLog.debug, centre, name)
|
||||||
@ -50,7 +52,7 @@ def creePointsPipePeau(listEdges, idFacesDebouchantes, idFillingFromBout,
|
|||||||
edgesCirc = list()
|
edgesCirc = list()
|
||||||
for grpEdgesCirc in grpsEdgesCirc:
|
for grpEdgesCirc in grpsEdgesCirc:
|
||||||
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
edgesCirc += geompy.ExtractShapes(grpEdgesCirc, geompy.ShapeType["EDGE"], False)
|
||||||
logging.info("edgesCirc: %s", edgesCirc)
|
logging.debug("edgesCirc: %s", edgesCirc)
|
||||||
|
|
||||||
for i_aux, edge in enumerate(edges):
|
for i_aux, edge in enumerate(edges):
|
||||||
extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
|
extrems = geompy.ExtractShapes(edge, geompy.ShapeType["VERTEX"], True)
|
||||||
|
@ -30,13 +30,13 @@ error = 40
|
|||||||
critical = 50
|
critical = 50
|
||||||
always = 100
|
always = 100
|
||||||
|
|
||||||
filelog = os.path.join(tempfile.gettempdir(),"blocFissure.log")
|
LOGFILE = os.path.join(tempfile.gettempdir(),"blocFissure.log")
|
||||||
|
|
||||||
loglevel = warning
|
LOG_LEVEL = warning
|
||||||
|
|
||||||
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', \
|
logging.basicConfig(format='%(funcName)s[%(lineno)d] %(message)s', \
|
||||||
level=logging.WARNING, \
|
level=logging.WARNING, \
|
||||||
filename=filelog, filemode='w')
|
filename=LOGFILE, filemode='w')
|
||||||
ch = None
|
ch = None
|
||||||
fh = None
|
fh = None
|
||||||
|
|
||||||
@ -64,49 +64,58 @@ def setLogger(logfile, level, formatter):
|
|||||||
|
|
||||||
def setDebug(logfile=None):
|
def setDebug(logfile=None):
|
||||||
"""setDebug"""
|
"""setDebug"""
|
||||||
global loglevel
|
global LOG_LEVEL
|
||||||
loglevel = debug
|
LOG_LEVEL = debug
|
||||||
level = logging.DEBUG
|
level = logging.DEBUG
|
||||||
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
|
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
|
||||||
setLogger(logfile, level, formatter)
|
setLogger(logfile, level, formatter)
|
||||||
logging.info('start Debug %s', loglevel)
|
logging.info('start Debug %s', LOG_LEVEL)
|
||||||
|
|
||||||
def setVerbose(logfile=None):
|
def setVerbose(logfile=None):
|
||||||
"""setVerbose"""
|
"""setVerbose"""
|
||||||
global loglevel
|
global LOG_LEVEL
|
||||||
loglevel = info
|
LOG_LEVEL = info
|
||||||
level = logging.INFO
|
level = logging.INFO
|
||||||
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
|
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
|
||||||
setLogger(logfile, level, formatter)
|
setLogger(logfile, level, formatter)
|
||||||
logging.info('start Verbose %s', loglevel)
|
logging.info('start Verbose %s', LOG_LEVEL)
|
||||||
|
|
||||||
def setRelease(logfile=None):
|
def setRelease(logfile=None):
|
||||||
"""setRelease"""
|
"""setRelease"""
|
||||||
global loglevel
|
global LOG_LEVEL
|
||||||
loglevel = warning
|
LOG_LEVEL = warning
|
||||||
level = logging.WARNING
|
level = logging.WARNING
|
||||||
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
|
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
|
||||||
setLogger(logfile, level, formatter)
|
setLogger(logfile, level, formatter)
|
||||||
logging.warning('start Release %s', loglevel)
|
logging.warning('start Release %s', LOG_LEVEL)
|
||||||
|
|
||||||
def setUnitTests(logfile=None):
|
def setUnitTests(logfile=None):
|
||||||
"""setUnitTests"""
|
"""setUnitTests"""
|
||||||
global loglevel
|
global LOG_LEVEL
|
||||||
loglevel = critical
|
LOG_LEVEL = critical
|
||||||
level = logging.CRITICAL
|
level = logging.CRITICAL
|
||||||
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
|
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
|
||||||
setLogger(logfile, level, formatter)
|
setLogger(logfile, level, formatter)
|
||||||
logging.critical('start UnitTests %s', loglevel)
|
logging.critical('start UnitTests %s', LOG_LEVEL)
|
||||||
|
|
||||||
def setPerfTests(logfile=None):
|
def setPerfTests(logfile=None):
|
||||||
"""setPerfTests"""
|
"""setPerfTests"""
|
||||||
global loglevel
|
global LOG_LEVEL
|
||||||
loglevel = critical
|
LOG_LEVEL = critical
|
||||||
level = logging.CRITICAL
|
level = logging.CRITICAL
|
||||||
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
|
formatter = logging.Formatter('%(funcName)s[%(lineno)d] %(message)s')
|
||||||
setLogger(logfile, level, formatter)
|
setLogger(logfile, level, formatter)
|
||||||
logging.info('start PerfTests %s', loglevel)
|
logging.info('start PerfTests %s', LOG_LEVEL)
|
||||||
|
|
||||||
|
def setAlways(logfile=None):
|
||||||
|
"""setAlways"""
|
||||||
|
global LOG_LEVEL
|
||||||
|
LOG_LEVEL = always
|
||||||
|
level = logging.CRITICAL
|
||||||
|
formatter = logging.Formatter('%(relativeCreated)d %(funcName)s[%(lineno)d] %(message)s')
|
||||||
|
setLogger(logfile, level, formatter)
|
||||||
|
logging.info('start Always %s', LOG_LEVEL)
|
||||||
|
|
||||||
def getLogLevel():
|
def getLogLevel():
|
||||||
"""getLogLevel"""
|
"""getLogLevel"""
|
||||||
return loglevel
|
return LOG_LEVEL
|
||||||
|
Loading…
Reference in New Issue
Block a user