Skip to content

Commit f284027

Browse files
committed
Imported logging as shorter log
1 parent c7e0153 commit f284027

2 files changed

Lines changed: 16 additions & 16 deletions

File tree

remove-json-keys/utils/bump.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import os, logging
1+
import logging as log, os
22
import tomli, tomli_w
33

4-
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
4+
log.basicConfig(level=log.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
55

66
pyproject_path = os.path.join(os.path.dirname(__file__), '../pyproject.toml')
77
with open(pyproject_path, 'rb') as file:
88
pkg_name = tomli.load(file)['project']['name']
99

1010
def update_changelog_url():
1111

12-
logging.debug(f'Loading {pyproject_path}...')
12+
log.debug(f'Loading {pyproject_path}...')
1313
with open(pyproject_path, 'rb') as file : pyproject = tomli.load(file)
1414

1515
ver_tag = f"{pkg_name}-{pyproject['project']['version']}"
1616
changelog_url = f'https://github.com/adamlui/python-utils/releases/tag/{ver_tag}'
17-
logging.debug(f'Generated changelog URL: {changelog_url}')
18-
17+
log.debug(f'Generated changelog URL: {changelog_url}')
18+
1919
if 'urls' not in pyproject['project']:
20-
logging.debug('Creating [project.urls] section...')
20+
log.debug('Creating [project.urls] section...')
2121
pyproject['project']['urls'] = {}
2222

23-
logging.debug(f"{ 'Updating' if 'Changelog' in pyproject['project']['urls'] else 'Adding new' } Changelog URL...")
23+
log.debug(f"{ 'Updating' if 'Changelog' in pyproject['project']['urls'] else 'Adding new' } Changelog URL...")
2424
pyproject['project']['urls']['Changelog'] = changelog_url
2525
with open(pyproject_path, 'wb') as file : tomli_w.dump(pyproject, file)
2626

27-
logging.info(f"Bumped changelog URL ver tag to [{ver_tag}]!")
27+
log.info(f"Bumped changelog URL ver tag to [{ver_tag}]!")
2828

2929
update_changelog_url()

translate-messages/utils/bump.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import os, logging
1+
import logging as log, os
22
import tomli, tomli_w
33

4-
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
4+
log.basicConfig(level=log.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
55

66
pyproject_path = os.path.join(os.path.dirname(__file__), '../pyproject.toml')
77
with open(pyproject_path, 'rb') as file:
88
pkg_name = tomli.load(file)['project']['name']
99

1010
def update_changelog_url():
1111

12-
logging.debug(f'Loading {pyproject_path}...')
12+
log.debug(f'Loading {pyproject_path}...')
1313
with open(pyproject_path, 'rb') as file : pyproject = tomli.load(file)
1414

1515
ver_tag = f"{pkg_name}-{pyproject['project']['version']}"
1616
changelog_url = f'https://github.com/adamlui/python-utils/releases/tag/{ver_tag}'
17-
logging.debug(f'Generated changelog URL: {changelog_url}')
18-
17+
log.debug(f'Generated changelog URL: {changelog_url}')
18+
1919
if 'urls' not in pyproject['project']:
20-
logging.debug('Creating [project.urls] section...')
20+
log.debug('Creating [project.urls] section...')
2121
pyproject['project']['urls'] = {}
2222

23-
logging.debug(f"{ 'Updating' if 'Changelog' in pyproject['project']['urls'] else 'Adding new' } Changelog URL...")
23+
log.debug(f"{ 'Updating' if 'Changelog' in pyproject['project']['urls'] else 'Adding new' } Changelog URL...")
2424
pyproject['project']['urls']['Changelog'] = changelog_url
2525
with open(pyproject_path, 'wb') as file : tomli_w.dump(pyproject, file)
2626

27-
logging.info(f"Bumped changelog URL ver tag to [{ver_tag}]!")
27+
log.info(f"Bumped changelog URL ver tag to [{ver_tag}]!")
2828

2929
update_changelog_url()

0 commit comments

Comments
 (0)