Hansimov commited on
Commit
b96cef7
1 Parent(s): e916990

:zap: [Enhance] Cleaner logger output

Browse files
Files changed (2) hide show
  1. networks/message_streamer.py +1 -1
  2. utils/enver.py +3 -4
networks/message_streamer.py CHANGED
@@ -60,7 +60,7 @@ class MessageStreamer:
60
  },
61
  "stream": stream,
62
  }
63
- print(self.request_url)
64
  enver.set_envs(proxies=True)
65
  stream = requests.post(
66
  self.request_url,
 
60
  },
61
  "stream": stream,
62
  }
63
+ logger.back(self.request_url)
64
  enver.set_envs(proxies=True)
65
  stream = requests.post(
66
  self.request_url,
utils/enver.py CHANGED
@@ -1,8 +1,8 @@
1
  import json
2
- import requests
3
  import os
4
 
5
  from pathlib import Path
 
6
 
7
 
8
  class OSEnver:
@@ -15,8 +15,6 @@ class OSEnver:
15
 
16
  def restore_envs(self):
17
  self.envs = self.envs_stack.pop()
18
- if self.global_scope:
19
- os.environ = self.envs
20
 
21
  def set_envs(self, secrets=True, proxies=None, store_envs=True):
22
  # caller_info = inspect.stack()[1]
@@ -55,7 +53,8 @@ class OSEnver:
55
  "https": self.proxy,
56
  }
57
 
58
- print(f"Using proxy: [{self.proxy}]")
 
59
 
60
 
61
  enver = OSEnver()
 
1
  import json
 
2
  import os
3
 
4
  from pathlib import Path
5
+ from utils.logger import logger
6
 
7
 
8
  class OSEnver:
 
15
 
16
  def restore_envs(self):
17
  self.envs = self.envs_stack.pop()
 
 
18
 
19
  def set_envs(self, secrets=True, proxies=None, store_envs=True):
20
  # caller_info = inspect.stack()[1]
 
53
  "https": self.proxy,
54
  }
55
 
56
+ if self.proxy:
57
+ logger.note(f"Using proxy: [{self.proxy}]")
58
 
59
 
60
  enver = OSEnver()