thats not really your entire program, since your sqlalchemy
configuration is in "conf", and I also cant see where youre setting
up your logging config. im also assuming youre using the sqlalchemy
trunk since thats where the logging module is being used. a
completely standalone program is much more useful.
make sure that you dont have any "echo=True" keywords anywhere within
your SQLAlchemy setup, since that is what makes it try to configure
logging on its own.
On Oct 16, 2006, at 8:52 AM, metaperl wrote:
>
> My logging messages do not show up when SQL Alchemy is using
> logging to
> show its messages. Any way to fix this? My program is below:
>
>
> #!/usr/bin/env python
>
> # system modules
> import logging, pprint, re, sys
>
> # 3rd party modules
> import argparse
>
> # local modules
> import abstracts, conf, htmlmail, resultgroup, sqlgen, users
> sys.path.append('..')
> import data.storage
>
>
> bad_data = [
>
> ]
>
>
> def main():
>
>
> p = argparse.ArgumentParser(prog='proc.py')
> p.add_argument('--test_login', help = 'optional test login')
> p.add_argument('--no_send', help = 'optional do not send generated
> email')
> args = p.parse_args(sys.argv[1:])
>
>
> sa = conf.sqlalchemy()
>
> ar_users = users.load_all(sa, args.test_login)
>
>
>
> for ar_user in ar_users:
> if ar_user['userid'] in [ x[0] for x in bad_data ]: continue
> """Email addresses with spaces wreak havoc when I try to write
> files
> with that name. Solution is here:
>
> http://groups.google.com/group/comp.databases.ms-sqlserver/
> browse_thread/thread/4ce6b202d8e231cc/
> fba2da51d58a4679#fba2da51d58a4679
> """
> user_email = re.compile(r'\s+').sub('', ar_user['email'])
>
> logging.info("====================================")
>
> rg = resultgroup.resultgroup(user_email)
>
> logging.info(pprint.pformat(ar_user))
> logging.debug('USER_KEYS: %r', ar_user.keys())
>
> user_searches = users.searches(sa, ar_user['userid'])
> for user_search in user_searches:
>
> if user_search['search'] is None: continue
> logging.info("----------------------------------")
> logging.info(pprint.pformat(user_search))
> logging.debug("SEARCH_KEYS %r", user_search.keys())
> sql, or_snippet = sqlgen.sqlgen(user_search['search'])
> new, old = abstracts.fulltext_results(sa, sql)
>
> rg.resultset.append( resultgroup.resultset(or_snippet,
> new,
> old) )
>
> rg.genhtml()
> if args.no_send:
> logging.info("No send mode... not sending email")
> else:
> htmlmail.send(rg.htmlfile, user_email)
>
>
> if __name__ == '__main__':
> main()
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---