Files
tryton/bin/trytond
T
Bertrand Chenal cb4971ac6e Logging refectoring:
* simplified mechanism

* reverted color on error, warning and critical messages in
  console. (inspired by openerp rev. 1085)
2008-09-12 19:57:33 +02:00

29 lines
900 B
Python
Executable File

#!/usr/bin/env python
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
import sys, os
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
'..', '..', 'trytond')))
if os.path.isdir(DIR):
sys.path.insert(0, os.path.dirname(DIR))
import trytond
if 0:
import profile
import pstats
import tempfile
import os
statfile = tempfile.mkstemp(".stat","trytond-")[1]
profile.run('trytond.TrytonServer().run()', statfile)
s = pstats.Stats(statfile)
s.strip_dirs().sort_stats('cumulative').print_stats(50)
s.strip_dirs().sort_stats('call').print_stats(50)
s.strip_dirs().sort_stats('time').print_stats(50)
s.strip_dirs().sort_stats('time')
s.print_callers(20)
s.print_callees(20)
os.remove(statfile)
else:
trytond.server.TrytonServer().run()