updated logging usage, to use the library directly and avoid imposing a core config by default, allowing users of the core library to configure logging as desired
This commit is contained in:
parent
37f747c212
commit
7aee2b2ba7
44 changed files with 552 additions and 527 deletions
|
@ -3,8 +3,9 @@ security.py: defines security services (vpnclient, vpnserver, ipsec and
|
|||
firewall)
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
from core import constants
|
||||
from core import logger
|
||||
from core.service import CoreService
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@ class VPNClient(CoreService):
|
|||
try:
|
||||
cfg += open(fname, "rb").read()
|
||||
except IOError:
|
||||
logger.exception("Error opening VPN client configuration template (%s)", fname)
|
||||
logging.exception("Error opening VPN client configuration template (%s)", fname)
|
||||
|
||||
return cfg
|
||||
|
||||
|
@ -56,7 +57,7 @@ class VPNServer(CoreService):
|
|||
try:
|
||||
cfg += open(fname, "rb").read()
|
||||
except IOError:
|
||||
logger.exception("Error opening VPN server configuration template (%s)", fname)
|
||||
logging.exception("Error opening VPN server configuration template (%s)", fname)
|
||||
|
||||
return cfg
|
||||
|
||||
|
@ -83,7 +84,7 @@ class IPsec(CoreService):
|
|||
try:
|
||||
cfg += open(fname, "rb").read()
|
||||
except IOError:
|
||||
logger.exception("Error opening IPsec configuration template (%s)", fname)
|
||||
logging.exception("Error opening IPsec configuration template (%s)", fname)
|
||||
|
||||
return cfg
|
||||
|
||||
|
@ -107,7 +108,7 @@ class Firewall(CoreService):
|
|||
try:
|
||||
cfg += open(fname, "rb").read()
|
||||
except IOError:
|
||||
logger.exception("Error opening Firewall configuration template (%s)", fname)
|
||||
logging.exception("Error opening Firewall configuration template (%s)", fname)
|
||||
|
||||
return cfg
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue