skytools.git
13 years agopgq_node.version(): 3.0.0.12
Marko Kreen [Wed, 7 Dec 2011 11:52:12 +0000 (13:52 +0200)]
pgq_node.version(): 3.0.0.12

13 years agopgq.version(): 3.0.0.11
Marko Kreen [Wed, 7 Dec 2011 11:52:12 +0000 (13:52 +0200)]
pgq.version(): 3.0.0.11

13 years agopgq_node.drop_node: fix bugs in recent changes
Marko Kreen [Wed, 7 Dec 2011 11:50:47 +0000 (13:50 +0200)]
pgq_node.drop_node: fix bugs in recent changes

Add function to regtests to avoid such problems in future.

13 years agoDBScript: simpler removal of password info
Marko Kreen [Wed, 7 Dec 2011 11:33:30 +0000 (13:33 +0200)]
DBScript: simpler removal of password info

PG connect strings can be quite free-form.
So remove everything after 'password'.

13 years agoskylog: use LoggerAdapter to give .trace method
Marko Kreen [Wed, 7 Dec 2011 11:32:29 +0000 (13:32 +0200)]
skylog: use LoggerAdapter to give .trace method

Replacing the default logger class seems dubious.

13 years agoMerge remote branch 'martino/master'
Marko Kreen [Wed, 7 Dec 2011 10:23:17 +0000 (12:23 +0200)]
Merge remote branch 'martino/master'

13 years agolondiste.handlers.dispatch: make part_func name configurable
Marko Kreen [Wed, 7 Dec 2011 10:17:24 +0000 (12:17 +0200)]
londiste.handlers.dispatch: make part_func name configurable

13 years agolondiste.local_add_table: ignore merge situation if copy is not needed
Marko Kreen [Wed, 7 Dec 2011 10:15:01 +0000 (12:15 +0200)]
londiste.local_add_table: ignore merge situation if copy is not needed

This allows unsyncromized adding in different leafs, with --expect-sync.

No reason to throw error in such case.

13 years agolondiste.local_remove_table: clean table_attrs
Marko Kreen [Wed, 7 Dec 2011 10:14:05 +0000 (12:14 +0200)]
londiste.local_remove_table: clean table_attrs

Still no good idea what to do with dropped_ddl

13 years agoMerge branch 'master' of git://github.com/markokr/skytools
Marko Kreen [Wed, 7 Dec 2011 10:13:11 +0000 (12:13 +0200)]
Merge branch 'master' of git://github.com/markokr/skytools

13 years agoskytools.signal_pidfile: ignore empty pidfile, some cleanups
Marko Kreen [Wed, 7 Dec 2011 10:10:34 +0000 (12:10 +0200)]
skytools.signal_pidfile: ignore empty pidfile, some cleanups

Empty pidfile can happen if old process failed to write it
for some reason.

13 years agoMerge pull request #6 from antiveeranna/master
Marko Kreen [Wed, 7 Dec 2011 10:02:56 +0000 (02:02 -0800)]
Merge pull request #6 from antiveeranna/master

Filter password in connstr before logging it

13 years agoskytools.__init__: alphabetically ordered modules / symbols
martinko [Tue, 6 Dec 2011 15:12:00 +0000 (17:12 +0200)]
skytools.__init__: alphabetically ordered modules / symbols

13 years agoMerge branch 'master' of skype-git:/git/dba/skytools-3
martinko [Tue, 6 Dec 2011 14:48:40 +0000 (16:48 +0200)]
Merge branch 'master' of skype-git:/git/dba/skytools-3

13 years agoskytools.skylog: fixed SkyLogger.trace() vs funcName format attribute
martinko [Tue, 6 Dec 2011 10:31:06 +0000 (12:31 +0200)]
skytools.skylog: fixed SkyLogger.trace() vs funcName format attribute

13 years agofilter potential passwords in connstr before logging it
anti.veeranna [Tue, 6 Dec 2011 08:17:40 +0000 (10:17 +0200)]
filter potential passwords in connstr before logging it

13 years agoreworked custom logging init
martinko [Mon, 5 Dec 2011 16:28:21 +0000 (18:28 +0200)]
reworked custom logging init

SkyLogger is no more installed automatically on scripting.py loading,
rather exlicitly when our custom getLogger() function is called.

13 years agoskylog: add job_name, service_name, hostname to LogRecord
Marko Kreen [Thu, 1 Dec 2011 12:47:09 +0000 (14:47 +0200)]
skylog: add job_name, service_name, hostname to LogRecord

This makes those fields usable everywhere.

As discussed in comment, no better way to do it.

Also remove few per-msg gethostname() calls.

13 years agoskylog.ini: sample for syslog
Marko Kreen [Thu, 1 Dec 2011 12:45:43 +0000 (14:45 +0200)]
skylog.ini: sample for syslog

13 years agosql upgrade cleanup
Marko Kreen [Tue, 29 Nov 2011 14:23:46 +0000 (16:23 +0200)]
sql upgrade cleanup

- use 'structure/upgrade.sql' to generate X.upgrade.sql
- add pgq_ext to upgraded schemas
- move non-standard upgrade scripts to extra/
- setup_skytools: build sql files in 'build' target, not always
- pgq_ext.version: bump ver to 3.0.0.1

13 years agoskytools_upgrade: if schema too old, stop touching it
Marko Kreen [Tue, 29 Nov 2011 13:08:37 +0000 (15:08 +0200)]
skytools_upgrade: if schema too old, stop touching it

13 years agosetup_skytools: install skytools_upgrade.py
Marko Kreen [Tue, 29 Nov 2011 11:15:23 +0000 (13:15 +0200)]
setup_skytools: install skytools_upgrade.py

13 years agoskylog: record.name is not jobname anymore
Marko Kreen [Tue, 29 Nov 2011 09:48:57 +0000 (11:48 +0200)]
skylog: record.name is not jobname anymore

13 years agopgq.register_consumer_at: fix docstring
Marko Kreen [Tue, 29 Nov 2011 09:46:45 +0000 (11:46 +0200)]
pgq.register_consumer_at: fix docstring

13 years agoskytools/scripting.py: added new log level TRACE that is below DEBUG level
martinko [Mon, 28 Nov 2011 17:09:30 +0000 (18:09 +0100)]
skytools/scripting.py: added new log level TRACE that is below DEBUG level

Added new "debug-2" log level that is intended for finer-grained informational events than DEBUG log level.

13 years agoMerge remote-tracking branch 'klando/for_marko'
Marko Kreen [Fri, 25 Nov 2011 14:36:40 +0000 (16:36 +0200)]
Merge remote-tracking branch 'klando/for_marko'

Conflicts:
README

13 years agoREADME: PgQ review
Cédric Villemain [Fri, 25 Nov 2011 13:13:45 +0000 (14:13 +0100)]
README: PgQ review

Improve the PgQ overview and add some sentences from Hannu

13 years agodoc/Makefile: update for walmgr3 and londiste3
Cédric Villemain [Fri, 25 Nov 2011 13:47:28 +0000 (14:47 +0100)]
doc/Makefile: update for walmgr3 and londiste3

so the new file is build and the renamed one is still build

13 years agodoc/londiste3.txt: add londiste3 manpage
Cédric Villemain [Fri, 25 Nov 2011 13:45:08 +0000 (14:45 +0100)]
doc/londiste3.txt: add londiste3 manpage

Up to date with --help
Londiste man page is mostly written, it lacks maybe a QUICK START.

13 years agodoc/qadmin.txt: Update the man page
Cédric Villemain [Thu, 17 Nov 2011 14:59:55 +0000 (15:59 +0100)]
doc/qadmin.txt: Update the man page

The manpage contains now all the options and console commands
as well as not implemented commands.

there are items in the TODO list in the source, what about them in
the documentation ?

13 years agodoc/walmgr.txt: walmgr manpage review
Cédric Villemain [Thu, 17 Nov 2011 12:19:35 +0000 (13:19 +0100)]
doc/walmgr.txt: walmgr manpage review

The review is based on walmgr3 --help output and partial code review.

File has been rename from walmgr.txt

QUICK START reviewed for warm-standby.

13 years agopython/walmngr.py: update help and usage
Cédric Villemain [Thu, 17 Nov 2011 12:14:59 +0000 (13:14 +0100)]
python/walmngr.py: update help and usage

Add the xpartialsync command description and remove the -n switch
from usage (it is already present in --help)

13 years agolondiste.global_add_table: automatically add table to combined node
Marko Kreen [Fri, 25 Nov 2011 13:35:56 +0000 (15:35 +0200)]
londiste.global_add_table: automatically add table to combined node

13 years agosql/londiste: fix comment
Marko Kreen [Fri, 25 Nov 2011 13:35:18 +0000 (15:35 +0200)]
sql/londiste: fix comment

13 years agoskytools_upgrade: support 3.0-upgrades, walk databases
Marko Kreen [Fri, 25 Nov 2011 09:17:18 +0000 (11:17 +0200)]
skytools_upgrade: support 3.0-upgrades, walk databases

13 years agolondiste.handlers.dispatch: mention table name in mismatch warnings
Marko Kreen [Thu, 24 Nov 2011 15:40:57 +0000 (17:40 +0200)]
londiste.handlers.dispatch: mention table name in mismatch warnings

13 years agoskytools.scripting: fix fileConfig on python 2.5
Marko Kreen [Thu, 24 Nov 2011 09:08:54 +0000 (11:08 +0200)]
skytools.scripting: fix fileConfig on python 2.5

There is no disable_existing_loggers argument so
we need manually enable all loggers again.

13 years agoskytools.BaseScript: fix use_skylog vs. module level loggers.
Marko Kreen [Wed, 23 Nov 2011 20:16:05 +0000 (22:16 +0200)]
skytools.BaseScript: fix use_skylog vs. module level loggers.

We want to support loggers initialized on module import time,
but for some reason logging.config.fileConfig() disables all
existing loggers by default.

Set disable_existing_loggers=False when calling to stop such behaviour.

13 years agopgq_node.version(): 3.0.0.11
Marko Kreen [Tue, 22 Nov 2011 14:24:33 +0000 (16:24 +0200)]
pgq_node.version(): 3.0.0.11

13 years agopgq.version(): 3.0.0.10
Marko Kreen [Tue, 22 Nov 2011 14:24:33 +0000 (16:24 +0200)]
pgq.version(): 3.0.0.10

13 years agotodo: few ideas to avoid connstrings on command line
Marko Kreen [Mon, 21 Nov 2011 11:07:25 +0000 (13:07 +0200)]
todo: few ideas to avoid connstrings on command line

13 years agotests: replace 'replay' with 'worker'
Marko Kreen [Mon, 21 Nov 2011 11:06:43 +0000 (13:06 +0200)]
tests: replace 'replay' with 'worker'

13 years agodrop-node: better behaviour when node is down
Marko Kreen [Mon, 21 Nov 2011 11:06:15 +0000 (13:06 +0200)]
drop-node: better behaviour when node is down

13 years agopgq_node.drop_node: refuse to drop if node is our provider.
Marko Kreen [Mon, 21 Nov 2011 10:14:04 +0000 (12:14 +0200)]
pgq_node.drop_node: refuse to drop if node is our provider.

safety check, admin tool should have done change-provider
before dropping.

13 years agolondiste: remove 'replay' alias for 'worker'
Marko Kreen [Fri, 18 Nov 2011 16:27:51 +0000 (18:27 +0200)]
londiste: remove 'replay' alias for 'worker'

13 years agoskytools3.txt: Minor cleanup
Marko Kreen [Fri, 18 Nov 2011 14:41:59 +0000 (16:41 +0200)]
skytools3.txt: Minor cleanup

13 years agopgq_node.drop_node: cleanup
Marko Kreen [Fri, 18 Nov 2011 14:32:42 +0000 (16:32 +0200)]
pgq_node.drop_node: cleanup

- dont catch errors from pgq_node.unregister_subscriber,
  pgq.unregister_consumer is now silent.

- use pgq_node.unregister_location() to drop location, that will also
  send event on root.

- delete all state on pgq_node.subscriber_info when local node is dropped

- call pgq_node.unregister_subscriber() only when non-local node is dropped

13 years agopgq.unregister_consumer: do not raise errors
Marko Kreen [Fri, 18 Nov 2011 14:21:17 +0000 (16:21 +0200)]
pgq.unregister_consumer: do not raise errors

- be silent if consumer does not exist
- if subconsumers exist, unregister those too

13 years agocreate_partition.sql: regtests, add indexes
Marko Kreen [Fri, 18 Nov 2011 14:20:02 +0000 (16:20 +0200)]
create_partition.sql: regtests, add indexes

- add indexes and constraints from parent table
- use timestamptz instead of timestamptz
- regtests

13 years agodbstruct.rx_replace: report all input in exception.
Marko Kreen [Fri, 18 Nov 2011 09:58:35 +0000 (11:58 +0200)]
dbstruct.rx_replace: report all input in exception.

This helps to debug failures.

13 years agolondiste copy: fast exit if table is removed
Marko Kreen [Fri, 18 Nov 2011 09:55:24 +0000 (11:55 +0200)]
londiste copy: fast exit if table is removed

Old code crashed, which sucks.

It can leave constraints/fkeys unapplied, but its to complex to restore here.
Better let the trigger-happy admins clean after themselves.

13 years agoREADME: draft upgrade description
Marko Kreen [Thu, 17 Nov 2011 18:15:15 +0000 (20:15 +0200)]
README: draft upgrade description

13 years agopgq.insert_event: support working with pgq 2.x schema
Marko Kreen [Thu, 17 Nov 2011 18:03:06 +0000 (20:03 +0200)]
pgq.insert_event: support working with pgq 2.x schema

this allows to upgrade module without uprading schema.

13 years agoupgrade/final/v3.0_pgq_core.sql: generate, based on skytools_3_0_b0 tag
Marko Kreen [Thu, 17 Nov 2011 13:34:19 +0000 (15:34 +0200)]
upgrade/final/v3.0_pgq_core.sql: generate, based on skytools_3_0_b0 tag

13 years agoMerge remote-tracking branch 'martino/master' skytools_3_0_b0
Marko Kreen [Tue, 15 Nov 2011 21:20:18 +0000 (23:20 +0200)]
Merge remote-tracking branch 'martino/master'

13 years agolondiste.version(): 3.0.0.10
Marko Kreen [Tue, 15 Nov 2011 14:13:16 +0000 (16:13 +0200)]
londiste.version(): 3.0.0.10

13 years agopgq_node.version(): 3.0.0.10
Marko Kreen [Tue, 15 Nov 2011 14:13:16 +0000 (16:13 +0200)]
pgq_node.version(): 3.0.0.10

13 years agopgq.version(): 3.0.0.9
Marko Kreen [Tue, 15 Nov 2011 14:13:15 +0000 (16:13 +0200)]
pgq.version(): 3.0.0.9

13 years agochange-provider: catch error when unregistering
Marko Kreen [Tue, 15 Nov 2011 14:12:14 +0000 (16:12 +0200)]
change-provider: catch error when unregistering

13 years agodoc/todo: remove old/done items
Marko Kreen [Tue, 15 Nov 2011 14:10:18 +0000 (16:10 +0200)]
doc/todo: remove old/done items

13 years agoskytools.scripting: datefmt support in logging
martinko [Mon, 14 Nov 2011 19:54:46 +0000 (20:54 +0100)]
skytools.scripting: datefmt support in logging

13 years agoMerge remote-tracking branch 'intgit/master'
Marko Kreen [Mon, 14 Nov 2011 10:50:01 +0000 (12:50 +0200)]
Merge remote-tracking branch 'intgit/master'

13 years agodoc/devnotes: way to make 'git log' nicer
Marko Kreen [Mon, 14 Nov 2011 10:47:51 +0000 (12:47 +0200)]
doc/devnotes: way to make 'git log' nicer

13 years agosql/pgq_node: doc: describe workflow for cascaded consumer
Marko Kreen [Mon, 14 Nov 2011 10:46:47 +0000 (12:46 +0200)]
sql/pgq_node: doc: describe workflow for cascaded consumer

13 years agoskytools.AdminScript: fix typo
Marko Kreen [Mon, 14 Nov 2011 10:46:24 +0000 (12:46 +0200)]
skytools.AdminScript: fix typo

13 years agoskytools.BaseScript: .cf_defaults attribute
Marko Kreen [Mon, 14 Nov 2011 10:45:33 +0000 (12:45 +0200)]
skytools.BaseScript: .cf_defaults attribute

This gives simple way to add defaults

13 years agochange-provider: move old-provider ops to the end
Marko Kreen [Mon, 14 Nov 2011 10:44:31 +0000 (12:44 +0200)]
change-provider: move old-provider ops to the end

That means even if they fail, all the other nodes are already updated.

13 years agopgq_node.register_location: skip insert if location is null
Marko Kreen [Mon, 14 Nov 2011 10:43:47 +0000 (12:43 +0200)]
pgq_node.register_location: skip insert if location is null

This allows tag-dead for non-existing node.

13 years agoMaster xarchive now runs "sync" on slave.
Martin Pihlak [Thu, 10 Nov 2011 08:33:30 +0000 (10:33 +0200)]
Master xarchive now runs "sync" on slave.

This is an attempt at minimizing the chance of WAL file corruption
on slave server crash -- master xarchive command does not return
success until the the buffers on slave have been flushed to disk.

13 years agoscripts/scriptmgr.py: added --wait option
martinko [Tue, 8 Nov 2011 12:39:23 +0000 (13:39 +0100)]
scripts/scriptmgr.py: added --wait option

The new option will make ScriptMgr to wait for all jobs to finish their processing.
This applies to both "stop" and "restart" commands.
Btw, restarting should be (much) faster now.

13 years agoscriptmgr.py: fix small logging bug
martinko [Tue, 8 Nov 2011 11:29:48 +0000 (12:29 +0100)]
scriptmgr.py: fix small logging bug

13 years agoconfig.py: resubmit lost commit
martinko [Tue, 8 Nov 2011 11:29:03 +0000 (12:29 +0100)]
config.py: resubmit lost commit

13 years agoskytools.scripting: logging cleanup
Marko Kreen [Tue, 8 Nov 2011 08:16:35 +0000 (10:16 +0200)]
skytools.scripting: logging cleanup

- allow different log format when logging verbosely
- don't assign to self.log during __init__, instead use class var
  This allows subclass var to override self.log

13 years agoskytools: make apipkg visible outside
Marko Kreen [Mon, 7 Nov 2011 07:33:43 +0000 (09:33 +0200)]
skytools: make apipkg visible outside

Now it should be possible to re-use the module elsewhere.

13 years agoskytools.dedent: new function for removing indent
Marko Kreen [Fri, 4 Nov 2011 12:00:15 +0000 (14:00 +0200)]
skytools.dedent: new function for removing indent

extract code from .print_ini and make usable elsewhere too.

13 years agoskytools.sqltools: tolerate missing installer_config
Marko Kreen [Fri, 4 Nov 2011 11:59:14 +0000 (13:59 +0200)]
skytools.sqltools: tolerate missing installer_config

13 years agolondiste.playback: move plugin-only dest_table to table_info
Marko Kreen [Fri, 4 Nov 2011 11:50:19 +0000 (13:50 +0200)]
londiste.playback: move plugin-only dest_table to table_info

its pain to do in sql, so lets do it in python

13 years agotests/rename: test for --dest-table
Marko Kreen [Tue, 1 Nov 2011 21:33:58 +0000 (23:33 +0200)]
tests/rename: test for --dest-table

13 years agoCleanup and fix remaining bugs in --dest-table code
Marko Kreen [Tue, 1 Nov 2011 21:31:57 +0000 (23:31 +0200)]
Cleanup and fix remaining bugs in --dest-table code

13 years agopgq.Consumer: support .consumer_filter with lazy_fetch
Marko Kreen [Thu, 27 Oct 2011 20:39:15 +0000 (23:39 +0300)]
pgq.Consumer: support .consumer_filter with lazy_fetch

13 years agolondiste: support table renaming
Marko Kreen [Thu, 27 Oct 2011 13:28:06 +0000 (16:28 +0300)]
londiste: support table renaming

- add .dest_table field to londiste.table_info
- use it for mapping merged tables on leaf
- make handlers use it for sql generaion
- fkey-related functions keep using real table name

13 years agolondiste.handlers: turn off REAL_TABLE by default
Marko Kreen [Wed, 26 Oct 2011 13:48:02 +0000 (16:48 +0300)]
londiste.handlers: turn off REAL_TABLE by default

does not work on merged tables.

13 years agohandlers.dispatch: Fix quoting in temp table naming
Marko Kreen [Wed, 26 Oct 2011 07:47:50 +0000 (10:47 +0300)]
handlers.dispatch: Fix quoting in temp table naming

13 years agoMerge remote-tracking branch 'intgit/master'
Marko Kreen [Tue, 25 Oct 2011 12:44:59 +0000 (15:44 +0300)]
Merge remote-tracking branch 'intgit/master'

13 years agosetup_skytools: rename scripts in build dir, not install dir
Marko Kreen [Tue, 25 Oct 2011 12:36:20 +0000 (15:36 +0300)]
setup_skytools: rename scripts in build dir, not install dir

This avoids install overwriting compat scripts.

Stop supporting --script-suffix switch, too annoying.
Custom suffix is still possible via config.mak.

13 years agotests/londiste: sanitize a bit
Marko Kreen [Mon, 24 Oct 2011 19:52:11 +0000 (22:52 +0300)]
tests/londiste: sanitize a bit

turn off log grep to make output human-viewable

13 years agotestlib: use code blocks
Marko Kreen [Mon, 24 Oct 2011 19:51:43 +0000 (22:51 +0300)]
testlib: use code blocks

13 years agolondiste.handlers.dispatch: 'analyze' argument for handlers
Marko Kreen [Fri, 21 Oct 2011 10:58:41 +0000 (13:58 +0300)]
londiste.handlers.dispatch: 'analyze' argument for handlers

Make ANALYZE on temp tables configurable and off by default

13 years agolondiste.handlers.dispatch: cache dist fields
Marko Kreen [Fri, 21 Oct 2011 10:35:17 +0000 (13:35 +0300)]
londiste.handlers.dispatch: cache dist fields

13 years agoFix skytools3-walmgr dependencies (support 9.1)
Dimitri Fontaine [Mon, 17 Oct 2011 15:06:18 +0000 (17:06 +0200)]
Fix skytools3-walmgr dependencies (support 9.1)

13 years agoMerge pull request #3 from lalinsky/splitkeys
Marko Kreen [Mon, 17 Oct 2011 10:21:26 +0000 (03:21 -0700)]
Merge pull request #3 from lalinsky/splitkeys

skytools.parse_sqltriga_sql: Split key and value fields in parse_logtriga_sql

13 years agoMerge pull request #2 from lalinsky/master
Marko Kreen [Mon, 17 Oct 2011 10:18:09 +0000 (03:18 -0700)]
Merge pull request #2 from lalinsky/master

Fix compilation of logtriga on PostgreSQL 9.0

13 years agoAdd an option to split the key and value fields
Lukáš Lalinský [Sun, 16 Oct 2011 11:20:31 +0000 (13:20 +0200)]
Add an option to split the key and value fields

13 years agoFix compilation of logtriga on PostgreSQL 9
Lukáš Lalinský [Sun, 16 Oct 2011 09:33:02 +0000 (11:33 +0200)]
Fix compilation of logtriga on PostgreSQL 9

This patch copies the is_keyword function from sql/pgq/triggers/stringutil.c
and uses it instead of calling ScanKeywordLookup directly. It also avoid
quoting some strings that are not reserved keywords.

13 years agoreset synchronous_standby_names on walmgr "stop".
Martin Pihlak [Fri, 14 Oct 2011 14:20:53 +0000 (17:20 +0300)]
reset synchronous_standby_names on walmgr "stop".

13 years agoMerge branch 'master' of internal-git:/git/dba/skytools-3
Martin Pihlak [Fri, 14 Oct 2011 14:01:42 +0000 (17:01 +0300)]
Merge branch 'master' of internal-git:/git/dba/skytools-3

13 years agoadd "pg_archivecleanup" to recovery.conf.
Martin Pihlak [Fri, 14 Oct 2011 13:31:07 +0000 (16:31 +0300)]
add "pg_archivecleanup" to recovery.conf.

13 years agoadd "primary_conninfo" option to --init-slave
Martin Pihlak [Fri, 14 Oct 2011 12:42:46 +0000 (15:42 +0300)]
add "primary_conninfo" option to --init-slave

13 years agoadded init.d script guessing.
Martin Pihlak [Fri, 14 Oct 2011 12:15:48 +0000 (15:15 +0300)]
added init.d script guessing.

13 years agoskytools.scripting: make non-skylog logging attach to root
Marko Kreen [Fri, 14 Oct 2011 06:32:29 +0000 (09:32 +0300)]
skytools.scripting: make non-skylog logging attach to root

use_skylog logging was already doing it.  Now that simple
logging does it do, using self.log is not mandatory anymore,
code can use 'logging' module directly.

Also make console and logfile output configurable.