lanscape 1.3.2a10__py3-none-any.whl → 1.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lanscape might be problematic. Click here for more details.
- lanscape/libraries/logger.py +3 -2
- lanscape/libraries/runtime_args.py +4 -5
- {lanscape-1.3.2a10.dist-info → lanscape-1.3.3.dist-info}/METADATA +3 -3
- {lanscape-1.3.2a10.dist-info → lanscape-1.3.3.dist-info}/RECORD +7 -7
- {lanscape-1.3.2a10.dist-info → lanscape-1.3.3.dist-info}/WHEEL +0 -0
- {lanscape-1.3.2a10.dist-info → lanscape-1.3.3.dist-info}/licenses/LICENSE +0 -0
- {lanscape-1.3.2a10.dist-info → lanscape-1.3.3.dist-info}/top_level.txt +0 -0
lanscape/libraries/logger.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
from logging.handlers import RotatingFileHandler
|
|
3
3
|
import click
|
|
4
|
+
from typing import Optional
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
def configure_logging(loglevel: str, logfile:
|
|
7
|
+
def configure_logging(loglevel: str, logfile: Optional[str], flask_logging: bool = False) -> None:
|
|
7
8
|
numeric_level = getattr(logging, loglevel.upper(), None)
|
|
8
9
|
if not isinstance(numeric_level, int):
|
|
9
10
|
raise ValueError(f'Invalid log level: {loglevel}')
|
|
@@ -17,7 +18,7 @@ def configure_logging(loglevel: str, logfile: bool, flask_logging: bool = False)
|
|
|
17
18
|
|
|
18
19
|
if logfile:
|
|
19
20
|
handler = RotatingFileHandler(
|
|
20
|
-
|
|
21
|
+
logfile, maxBytes=100000, backupCount=3)
|
|
21
22
|
handler.setLevel(numeric_level)
|
|
22
23
|
formatter = logging.Formatter(
|
|
23
24
|
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import argparse
|
|
2
1
|
from dataclasses import dataclass, fields
|
|
3
2
|
import argparse
|
|
4
|
-
from typing import Any, Dict
|
|
3
|
+
from typing import Any, Dict, Optional
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
@dataclass
|
|
8
7
|
class RuntimeArgs:
|
|
9
8
|
reloader: bool = False
|
|
10
9
|
port: int = 5001
|
|
11
|
-
logfile:
|
|
10
|
+
logfile: Optional[str] = None
|
|
12
11
|
loglevel: str = 'INFO'
|
|
13
12
|
flask_logging: bool = False
|
|
14
13
|
persistent: bool = False
|
|
@@ -21,8 +20,8 @@ def parse_args() -> RuntimeArgs:
|
|
|
21
20
|
help='Use flask\'s reloader (helpful for local development)')
|
|
22
21
|
parser.add_argument('--port', type=int, default=5001,
|
|
23
22
|
help='Port to run the webserver on')
|
|
24
|
-
parser.add_argument('--logfile',
|
|
25
|
-
help='Log output to
|
|
23
|
+
parser.add_argument('--logfile', type=str, default=None,
|
|
24
|
+
help='Log output to the specified file path')
|
|
26
25
|
parser.add_argument('--loglevel', default='INFO', help='Set the log level')
|
|
27
26
|
parser.add_argument('--flask-logging', action='store_true',
|
|
28
27
|
help='Enable flask logging (disables click output)')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lanscape
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: A python based local network scanner
|
|
5
5
|
Author-email: Michael Dennis <michael@dipduo.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -37,7 +37,7 @@ python -m lanscape
|
|
|
37
37
|
- `--port <port number>` port of the flask app (default: automagic)
|
|
38
38
|
- `--persistent` dont shutdown server when browser tab is closed (default: false)
|
|
39
39
|
- `--reloader` essentially flask debug mode- good for local development (default: false)
|
|
40
|
-
- `--logfile
|
|
40
|
+
- `--logfile <path>` save log output to the given file path
|
|
41
41
|
- `--loglevel <level>` set the logger's log level (default: INFO)
|
|
42
42
|
- `--flask-logging` turn on flask logging (default: false)
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ Examples:
|
|
|
45
45
|
```shell
|
|
46
46
|
python -m lanscape --reloader
|
|
47
47
|
python -m lanscape --port 5002
|
|
48
|
-
python -m lanscape --logfile --loglevel DEBUG
|
|
48
|
+
python -m lanscape --logfile /tmp/lanscape.log --loglevel DEBUG
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
## Troubleshooting
|
|
@@ -5,11 +5,11 @@ lanscape/libraries/app_scope.py,sha256=VvZPtIGWmtDFahliL1rOVYAIvFXoykyh-ZEUqylPj
|
|
|
5
5
|
lanscape/libraries/decorators.py,sha256=P4GyH25bqs5HIr6OncdrptQpb2l0Yx8Ogfau_gD1mII,5064
|
|
6
6
|
lanscape/libraries/errors.py,sha256=EzJA5_rh9xzu5HEfwyxIyHZBEBFkekx2dwwOjprfw-g,940
|
|
7
7
|
lanscape/libraries/ip_parser.py,sha256=sPTm1UQtCixtM8dq45ThGgCjiZQQcueI7OwkHLKYBIU,2151
|
|
8
|
-
lanscape/libraries/logger.py,sha256=
|
|
8
|
+
lanscape/libraries/logger.py,sha256=axADqgQhoDmdCOV3l4zTd9F6XaTgJf_XDg8I4jHGRoo,1436
|
|
9
9
|
lanscape/libraries/mac_lookup.py,sha256=VSZbsJ0UzwKptYLpGLi8MHUyFEaQntkayshnQuZKtSs,3390
|
|
10
10
|
lanscape/libraries/net_tools.py,sha256=02ZwZAm1LeS1qJQQMzwbxOETOkrlCGX5gwO4yiBofjE,17721
|
|
11
11
|
lanscape/libraries/port_manager.py,sha256=9nYGJmR1wliWx2ZuXJ4y_79up-dS8F2kKHJKf-rL758,2025
|
|
12
|
-
lanscape/libraries/runtime_args.py,sha256=
|
|
12
|
+
lanscape/libraries/runtime_args.py,sha256=3pPmb5-FSjSvU5KaVkvvzGY4u49Lt81PG85nA1CIPOw,2084
|
|
13
13
|
lanscape/libraries/scan_config.py,sha256=RCR4D1rwHsxgXiwH7ceEKeZbao6KEDgzc1hyZP9BH6o,2600
|
|
14
14
|
lanscape/libraries/service_scan.py,sha256=1pBf0A5HqzpcsR5vs2ifS6Opk35GKocNpgs-dJ4nXuA,1870
|
|
15
15
|
lanscape/libraries/subnet_scan.py,sha256=H2vlycSfyrLgRdcLgs83MCtyXO_V2OShQnd3DR-E68g,11737
|
|
@@ -62,8 +62,8 @@ lanscape/ui/templates/scan/ip-table-row.html,sha256=RANDsfW4xBATdtiLrxUlRouFSjgw
|
|
|
62
62
|
lanscape/ui/templates/scan/ip-table.html,sha256=CP7AG8WHOgy3AyYCIN0wA2wO6n0H1X0F9IOncQtpPvE,914
|
|
63
63
|
lanscape/ui/templates/scan/overview.html,sha256=xWj9jWDPg2KcPLvS8fnSins23_UXjKCdb2NJwNG2U2Q,1176
|
|
64
64
|
lanscape/ui/templates/scan/scan-error.html,sha256=wmAYQ13IJHUoO8fAGNDjMvNml7tu4rsIU3Vav71ETlA,999
|
|
65
|
-
lanscape-1.3.
|
|
66
|
-
lanscape-1.3.
|
|
67
|
-
lanscape-1.3.
|
|
68
|
-
lanscape-1.3.
|
|
69
|
-
lanscape-1.3.
|
|
65
|
+
lanscape-1.3.3.dist-info/licenses/LICENSE,sha256=VLoE0IrNTIc09dFm7hMN0qzk4T3q8V0NaPcFQqMemDs,1070
|
|
66
|
+
lanscape-1.3.3.dist-info/METADATA,sha256=u093TaN1L7VMnuylblkcTHVS35qjAocOTcFltj7pQhM,2567
|
|
67
|
+
lanscape-1.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
68
|
+
lanscape-1.3.3.dist-info/top_level.txt,sha256=E9D4sjPz_6H7c85Ycy_pOS2xuv1Wm-ilKhxEprln2ps,9
|
|
69
|
+
lanscape-1.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|