Merge pull request #300 from Atheros1/master

Move debug.log to the config directory
This commit is contained in:
Jonathan Warren 2013-07-14 13:14:30 -07:00
commit cb2f89a7bf
3 changed files with 12 additions and 11 deletions

View File

@ -32,7 +32,6 @@ from class_singleListener import *
from class_addressGenerator import *
# Helper Functions
import helper_startup
import helper_bootstrap
import sys
@ -719,8 +718,6 @@ if __name__ == "__main__":
signal.signal(signal.SIGINT, helper_generic.signal_handler)
# signal.signal(signal.SIGINT, signal.SIG_DFL)
helper_startup.loadConfig()
helper_bootstrap.knownNodes()
helper_bootstrap.dns()

View File

@ -18,6 +18,7 @@ Use: `from debug import logger` to import this facility into whatever module you
'''
import logging
import logging.config
import shared
# TODO(xj9): Get from a config file.
log_level = 'DEBUG'
@ -40,9 +41,9 @@ logging.config.dictConfig({
'class': 'logging.handlers.RotatingFileHandler',
'formatter': 'default',
'level': log_level,
'filename': 'bm.log',
'maxBytes': 1024,
'backupCount': 0,
'filename': shared.appdata + 'debug.log',
'maxBytes': 2097152, # 2 MiB
'backupCount': 1,
}
},
'loggers': {
@ -65,4 +66,5 @@ logging.config.dictConfig({
},
})
# TODO (xj9): Get from a config file.
logger = logging.getLogger('console_only')
#logger = logging.getLogger('console_only')
logger = logging.getLogger('both')

View File

@ -21,7 +21,8 @@ import socket
import random
import highlevelcrypto
import shared
from debug import logger
import helper_startup
config = ConfigParser.SafeConfigParser()
myECCryptorObjects = {}
@ -63,8 +64,6 @@ ackdataForWhichImWatching = {}
networkDefaultProofOfWorkNonceTrialsPerByte = 320 #The amount of work that should be performed (and demanded) per byte of the payload. Double this number to double the work.
networkDefaultPayloadLengthExtraBytes = 14000 #To make sending short messages a little more difficult, this value is added to the payload length for use in calculating the proof of work target.
def isInSqlInventory(hash):
t = (hash,)
shared.sqlLock.acquire()
@ -306,3 +305,6 @@ def fixPotentiallyInvalidUTF8Data(text):
except:
output = 'Part of the message is corrupt. The message cannot be displayed the normal way.\n\n' + repr(text)
return output
helper_startup.loadConfig()
from debug import logger