# [rp]: True if you want inane blather while script runs. # [lb]: Why is log trace inane? Or, "Silly; stupid; not significant". # I find log statements extremely helpful for de-veloping/-bugging. log_level = logging.DEBUG log_to_file = True # Always log to console, so cron jobs can redirect output to specific logfile # (to analyze log for ERRORs). #log_to_console = False log_to_console = True log_line_len = None # Run from cron, $TERM is not set. Run from bash, it's 'xterm'. if ((os.environ.get('TERM') != 'dumb') and (os.environ.get('TERM') is not None)): log_to_console = True log_line_len = Console.getTerminalSize()[0] - 1 conf.init_logging(log_to_file, log_to_console, log_line_len, log_level) log = g.log.getLogger('apache2sql.py') from util_ import db_glue from util_ import misc from util_ import rect from util_.log_progger import Debug_Progress_Logger from util_.script_args import Ccp_Script_Args from util_.script_base import Ccp_Script_Base # *** Debugging control # Developer switches debug_limit = None
import psycopg2 import re import subprocess import time import traceback # NOTE: This has to come before importing other Cyclopath modules, otherwise # g.log.getLogger returns the base Python Logger() and not our MyLogger() import logging from util_ import logging2 from util_.console import Console log_level = logging.DEBUG #log_level = logging2.VERBOSE #log_level = logging2.VERBOSE4 #log_level = logging2.VERBOSE1 conf.init_logging(True, True, Console.getTerminalSize()[0]-1, log_level) log = g.log.getLogger('schema-up') # FIXME: TESTING. See logging2.config_line_format. Maybe don't word wrap. # FIXME: For cron, this is 79. log.debug('getTerminalSize: %d' % (Console.getTerminalSize()[0]-1,)) log.debug('os.getenv("LOGNAME"): %s' % (os.getenv('LOGNAME'),)) log.debug('os.environ.get("TERM"): %s' % (os.environ.get('TERM'),)) #Apr-20 20:40:20 DEBG schema-up # getTerminalSize: 109 #Apr-20 20:40:20 DEBG schema-up # os.getenv("LOGNAME"): landonb #Apr-20 20:40:20 DEBG schema-up # os.environ.get("TERM"): xterm from util_ import db_glue from util_ import misc from util_.script_args import Ccp_Script_Args
import traceback import conf import g import logging from util_.console import Console log_level = logging.DEBUG log_to_file = True log_to_console = True log_line_len = None if ((os.environ.get('TERM') != 'dumb') and (os.environ.get('TERM') is not None)): log_to_console = True log_line_len = Console.getTerminalSize()[0]-1 conf.init_logging(log_to_file, log_to_console, log_line_len, log_level) log = g.log.getLogger('wtchrs_emalr') from item.util.watcher_frequency import Watcher_Frequency from item.util.watcher_watcher import Watcher_Watcher from util_ import db_glue from util_ import misc from util_.emailer import Emailer from util_.log_progger import Debug_Progress_Logger from util_.script_args import Ccp_Script_Args from util_.script_base import Ccp_Script_Base # *** Debugging control # Developer switches debug_limit = None
# SYNC_ME: Search: Scripts: Load pyserver. import os import sys sys.path.insert(0, os.path.abspath('%s/../util' % (os.path.abspath(os.curdir), ))) import pyserver_glue import conf import g # *** Module globals # FIXME: Make sure this always comes before other Ccp imports import logging #from util_ import logging2 from util_.console import Console conf.init_logging(True, True, Console.getTerminalSize()[0] - 1, logging.DEBUG) log = g.log.getLogger('pop_rev_geo') # *** import time from grax.access_level import Access_Level from grax.grac_manager import Grac_Manager from grax.item_manager import Item_Manager from gwis.query_branch import Query_Branch from item import item_base from item import link_value from item.attc import attribute from item.feat import branch
# SYNC_ME: Search: Scripts: Load pyserver. import os import sys sys.path.insert(0, os.path.abspath('%s/../util' % (os.path.abspath(os.curdir),))) import pyserver_glue import conf import g # *** Module globals # FIXME: Make sure this always comes before other Ccp imports import logging #from util_ import logging2 from util_.console import Console conf.init_logging(True, True, Console.getTerminalSize()[0]-1, logging.DEBUG) log = g.log.getLogger('pop_rev_geo') # *** import time from grax.access_level import Access_Level from grax.grac_manager import Grac_Manager from grax.item_manager import Item_Manager from gwis.query_branch import Query_Branch from item import item_base from item import link_value from item.attc import attribute from item.feat import branch
import g # NOTE: This must come early, before triggering any other pyserver imports. import logging from util_ import logging2 # FIXME: This is overriding CONFIG's and conf.py's logging.level. log_level = logging.INFO #log_level = logging.DEBUG #log_level = logging2.VERBOSE1 #log_level = logging2.VERBOSE2 #log_level = logging2.VERBOSE3 #log_level = logging2.VERBOSE4 #log_level = logging2.VERBOSE conf.init_logging(log_to_file=True, log_to_console=False, log_line_len=conf.log_line_len, log_level_force=log_level, add_thread_id=True) log = g.log.getLogger('gwis_mod_python') import gwis.request from gwis.exception.gwis_fatal import GWIS_Fatal from gwis.exception.gwis_warning import GWIS_Warning # *** # Entry point from Apache # def handler(areq):