Skip to content

Commit

Permalink
logging improved
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo Bracciale committed Sep 8, 2022
1 parent 25a7aa3 commit 350da3d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ hike/
!/scripts/temp_credentials/config
scapy/
eclatd.log
log/*.log
4 changes: 1 addition & 3 deletions eclat.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def load(scriptfile, package, defines=[]):

# print the outcome
print(f"{response.status}: {response.message}")

return response


Expand Down Expand Up @@ -165,7 +165,6 @@ def main():

# implementing the commands
args = parser.parse_args()
print(args)

if args.cmd == 'load':
defines = args.define if hasattr(args, 'define') else []
Expand All @@ -186,7 +185,6 @@ def main():
else:
parser.error('No command specified.')

print(f"status: {ret.status}")
if ret.status == 'OK':
sys.exit(0)
else:
Expand Down
5 changes: 3 additions & 2 deletions package_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import logging

logger = logging.getLogger(__name__)
logger = logging.getLogger()

class PackageManager:
"""
Expand Down Expand Up @@ -34,10 +34,11 @@ def pull(self, package_name):
if d['name'] == package_name:
logger.info(
f'Found {package_name} in the package list. Start cloning...')
logger.info(d)
logger.info(f"Package information retrieved: {str(d)}")
is_found = True
cal.clone_repo(
d['git_url'], f"{settings.COMPONENTS_DIR}/{package_name}", d['tag'])
logger.info(f"Package {package_name} cloned successfully")

if not is_found:
raise Exception(
Expand Down
2 changes: 1 addition & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"formatter":"std_out",
"class":"logging.FileHandler",
"level":"DEBUG",
"filename":"eclatd.log"
"filename":"log/eclatd.log"
}
},
"formatters":{
Expand Down

0 comments on commit 350da3d

Please sign in to comment.