apify 1.1.5b1__tar.gz → 1.1.6b2__tar.gz

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 apify might be problematic. Click here for more details.

Files changed (38) hide show
  1. {apify-1.1.5b1 → apify-1.1.6b2}/PKG-INFO +1 -1
  2. {apify-1.1.5b1 → apify-1.1.6b2}/pyproject.toml +1 -1
  3. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/event_manager.py +1 -1
  4. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/log.py +17 -1
  5. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify.egg-info/PKG-INFO +1 -1
  6. {apify-1.1.5b1 → apify-1.1.6b2}/LICENSE +0 -0
  7. {apify-1.1.5b1 → apify-1.1.6b2}/README.md +0 -0
  8. {apify-1.1.5b1 → apify-1.1.6b2}/setup.cfg +0 -0
  9. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/__init__.py +0 -0
  10. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_crypto.py +0 -0
  11. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/__init__.py +0 -0
  12. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/file_storage_utils.py +0 -0
  13. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/memory_storage_client.py +0 -0
  14. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/__init__.py +0 -0
  15. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/base_resource_client.py +0 -0
  16. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/base_resource_collection_client.py +0 -0
  17. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/dataset.py +0 -0
  18. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/dataset_collection.py +0 -0
  19. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/key_value_store.py +0 -0
  20. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/key_value_store_collection.py +0 -0
  21. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/request_queue.py +0 -0
  22. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_memory_storage/resource_clients/request_queue_collection.py +0 -0
  23. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/_utils.py +0 -0
  24. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/actor.py +0 -0
  25. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/config.py +0 -0
  26. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/consts.py +0 -0
  27. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/proxy_configuration.py +0 -0
  28. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/py.typed +0 -0
  29. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/storages/__init__.py +0 -0
  30. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/storages/base_storage.py +0 -0
  31. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/storages/dataset.py +0 -0
  32. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/storages/key_value_store.py +0 -0
  33. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/storages/request_queue.py +0 -0
  34. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify/storages/storage_client_manager.py +0 -0
  35. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify.egg-info/SOURCES.txt +0 -0
  36. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify.egg-info/dependency_links.txt +0 -0
  37. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify.egg-info/requires.txt +0 -0
  38. {apify-1.1.5b1 → apify-1.1.6b2}/src/apify.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apify
3
- Version: 1.1.5b1
3
+ Version: 1.1.6b2
4
4
  Summary: Apify SDK for Python
5
5
  Author-email: "Apify Technologies s.r.o." <support@apify.com>
6
6
  License: Apache Software License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "apify"
3
- version = "1.1.5b1"
3
+ version = "1.1.6b2"
4
4
  description = "Apify SDK for Python"
5
5
  readme = "README.md"
6
6
  license = {text = "Apache Software License"}
@@ -34,7 +34,7 @@ class EventManager:
34
34
  _connected_to_platform_websocket: Optional[asyncio.Future] = None
35
35
 
36
36
  def __init__(self, config: Configuration) -> None:
37
- """Crate an instance of EventManager.
37
+ """Create an instance of the EventManager.
38
38
 
39
39
  Args:
40
40
  config (Configuration): The actor configuration to be used in this event manager.
@@ -17,6 +17,7 @@ logger_name = __name__.split('.')[0]
17
17
  # Logger used throughout the library
18
18
  logger = logging.getLogger(logger_name)
19
19
 
20
+ _LOG_NAME_COLOR = Fore.LIGHTBLACK_EX
20
21
 
21
22
  _LOG_LEVEL_COLOR = {
22
23
  logging.DEBUG: Fore.BLUE,
@@ -54,6 +55,15 @@ class ActorLogFormatter(logging.Formatter):
54
55
  # and extract all the extra ones not present in the empty log record
55
56
  empty_record = logging.LogRecord('dummy', 0, 'dummy', 0, 'dummy', None, None)
56
57
 
58
+ def __init__(self, include_logger_name: bool = False, *args: tuple, **kwargs: dict) -> None:
59
+ """Create an instance of the ActorLogFormatter.
60
+
61
+ Args:
62
+ include_logger_name: Include logger name at the beginning of the log line. Defaults to False.
63
+ """
64
+ super().__init__(*args, **kwargs) # type: ignore
65
+ self.include_logger_name = include_logger_name
66
+
57
67
  def _get_extra_fields(self, record: logging.LogRecord) -> Dict[str, Any]:
58
68
  extra_fields: Dict[str, Any] = {}
59
69
  for key, value in record.__dict__.items():
@@ -72,6 +82,8 @@ class ActorLogFormatter(logging.Formatter):
72
82
  - then has the stringified extra log fields
73
83
  - then, if an exception is a part of the log record, prints the formatted exception.
74
84
  """
85
+ logger_name_string = f'{_LOG_NAME_COLOR}[{record.name}]{Style.RESET_ALL} '
86
+
75
87
  # Colorize the log level, and shorten it to 6 chars tops
76
88
  level_color_code = _LOG_LEVEL_COLOR.get(record.levelno, '')
77
89
  level_short_alias = _LOG_LEVEL_SHORT_ALIAS.get(record.levelno, record.levelname)
@@ -97,4 +109,8 @@ class ActorLogFormatter(logging.Formatter):
97
109
  log_string = super().format(record)
98
110
  log_string = textwrap.indent(log_string, _LOG_MESSAGE_INDENT).lstrip()
99
111
 
100
- return f'{level_string}{log_string}{extra_string}{exception_string}'
112
+ if self.include_logger_name:
113
+ # Include logger name at the beginning of the log line
114
+ return f'{logger_name_string}{level_string}{log_string}{extra_string}{exception_string}'
115
+ else:
116
+ return f'{level_string}{log_string}{extra_string}{exception_string}'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apify
3
- Version: 1.1.5b1
3
+ Version: 1.1.6b2
4
4
  Summary: Apify SDK for Python
5
5
  Author-email: "Apify Technologies s.r.o." <support@apify.com>
6
6
  License: Apache Software License
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes