Skip to content

Commit

Permalink
Merge branch 'main' into ci
Browse files Browse the repository at this point in the history
  • Loading branch information
un33k committed Feb 29, 2024
2 parents 728b9cb + e908cc3 commit 719ba46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
## 2.0.2

Enhance:
- Added logger name

## 2.0.1

Issue:
- Remove `HTTP_VIA` header support (unreliable IP information) (@yourcelf)

Expand All @@ -11,7 +17,7 @@ Enhance:
- Renamed the imported module from `ipware` to `python_ipware` in the `python-ipware` package.
- Old usage: `from ipware import IpWare`
- New usage: `from python_ipware import IpWare`

## 1.0.5

- Enhance: Readme updates
Expand Down
2 changes: 1 addition & 1 deletion python_ipware/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.0.1"
__version__ = "2.0.2"
6 changes: 4 additions & 2 deletions python_ipware/python_ipware.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
IpAddressType = Union[ipaddress.IPv4Address, ipaddress.IPv6Address]
OptionalIpAddressType = Optional[IpAddressType]

logger = logging.getLogger(__name__)


class IpWareMeta:
"""
Expand Down Expand Up @@ -105,7 +107,7 @@ def get_ip_object(
ip = ipaddress.IPv4Address(ipv4)
except ipaddress.AddressValueError:
# not a valid IP address, return None
logging.info("Invalid ip address. {0}".format(ip_str))
logger.info("Invalid ip address. {0}".format(ip_str))
ip = None
return ip

Expand Down Expand Up @@ -324,7 +326,7 @@ def get_best_ip(
"""

if not ip_list:
logging.warning("Invalid ip list provided.")
logger.warning("Invalid ip list provided.")
return None, False

# the incoming ips match our trusted proxy list
Expand Down

0 comments on commit 719ba46

Please sign in to comment.