Added a logger initialization to each module

This commit is contained in:
Anton Beloglazov 2012-09-25 15:59:45 +10:00
parent 886c58bb21
commit 7ac32c85b2
18 changed files with 54 additions and 0 deletions

View File

@ -20,6 +20,9 @@ from contracts import contract
import os
import ConfigParser
import logging
log = logging.getLogger(__name__)
# This is the default config, which should not be modified
#DEFAILT_CONFIG_PATH = "/etc/neat/neat.conf"

View File

@ -20,6 +20,9 @@ import sqlalchemy
import neat.db
# import novaclient
import logging
log = logging.getLogger(__name__)
new_contract('deque', collections.deque)
new_contract('function', lambda x: hasattr(x, '__call__'))

View File

@ -16,6 +16,9 @@ from contracts import contract
from sqlalchemy import *
from sqlalchemy.engine.base import Connection
import logging
log = logging.getLogger(__name__)
class Database(object):
""" A class representing the database, where fields are tables.

View File

@ -19,6 +19,9 @@ from sqlalchemy import *
from neat.db import Database
import logging
log = logging.getLogger(__name__)
@contract
def init_db(sql_connection):

View File

@ -78,6 +78,9 @@ from novaclient.v1_1 import client
from neat.config import *
from neat.db_utils import *
import logging
log = logging.getLogger(__name__)
ERRORS = {
400: 'Bad input parameter: incorrect or missing parameters',

View File

@ -18,6 +18,9 @@
from contracts import contract
from neat.contracts_extra import *
import logging
log = logging.getLogger(__name__)
@contract
def best_fit_decreasing_factory(time_step, migration_time, params):

View File

@ -100,6 +100,9 @@ import neat.common as common
from neat.config import *
from neat.db_utils import *
import logging
log = logging.getLogger(__name__)
@contract
def start():

View File

@ -110,6 +110,9 @@ import neat.common as common
from neat.config import *
from neat.db_utils import *
import logging
log = logging.getLogger(__name__)
@contract
def start():

View File

@ -21,6 +21,9 @@ from neat.contracts_extra import *
import nlp
from neat.common import frange
import logging
log = logging.getLogger(__name__)
@contract
def solve2(objective, constraint, step, limit):

View File

@ -22,6 +22,9 @@ import neat.locals.overload.mhod.multisize_estimation as estimation
import neat.locals.overload.mhod.bruteforce as bruteforce
from neat.locals.overload.mhod.l_2_states import ls
import logging
log = logging.getLogger(__name__)
@contract
def init_state(window_sizes, number_of_states):

View File

@ -18,6 +18,9 @@
from contracts import contract
from neat.contracts_extra import *
import logging
log = logging.getLogger(__name__)
@contract
def l0(p_initial, p_matrix, m):

View File

@ -21,6 +21,9 @@ from neat.contracts_extra import *
from itertools import islice
from collections import deque
import logging
log = logging.getLogger(__name__)
@contract
def mean(data, window_size):

View File

@ -20,6 +20,9 @@ from neat.contracts_extra import *
import operator
import logging
log = logging.getLogger(__name__)
@contract
def build_objective(ls, state_vector, p):

View File

@ -18,6 +18,9 @@
from contracts import contract
from neat.contracts_extra import *
import logging
log = logging.getLogger(__name__)
@contract
def otf_factory(time_step, migration_time, params):

View File

@ -22,6 +22,9 @@ from numpy import median
from scipy.optimize import leastsq
import numpy as np
import logging
log = logging.getLogger(__name__)
@contract
def loess_factory(time_step, migration_time, params):

View File

@ -18,6 +18,9 @@
from contracts import contract
from neat.contracts_extra import *
import logging
log = logging.getLogger(__name__)
@contract
def no_migrations_factory(time_step, migration_time, params):

View File

@ -18,6 +18,9 @@
from contracts import contract
from neat.contracts_extra import *
import logging
log = logging.getLogger(__name__)
@contract
def threshold_factory(time_step, migration_time, params):

View File

@ -21,6 +21,9 @@ from neat.contracts_extra import *
from random import choice
import operator
import logging
log = logging.getLogger(__name__)
@contract
def random_factory(time_step, migration_time, params):