+14
-1
src/main.py
+14
-1
src/main.py
···
19
19
format='%(asctime)s - %(levelname)s - %(message)s'
20
20
)
21
21
22
+
# Set up console logging
23
+
console_handler = logging.StreamHandler()
24
+
console_handler.setLevel(logging.DEBUG)
25
+
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
26
+
console_handler.setFormatter(formatter)
27
+
logging.getLogger().addHandler(console_handler)
28
+
22
29
logging.info("NEW EXECUTION OF APPLICATION\n\n\n")
30
+
print("Bluesky Markov Bot started.")
23
31
24
32
# Load environment variables
25
33
load_dotenv()
···
36
44
try:
37
45
source_client = login("SOURCE_HANDLE", "SRC_APP_PASS")
38
46
logging.info("Successfully logged in to source account.")
47
+
print("Successfully logged in to source account.")
39
48
40
49
source_did_package = DID_resolve(source_handle)
41
50
source_did = source_did_package['did']
···
43
52
44
53
destination_client = login("DESTINATION_HANDLE", "DST_APP_PASS")
45
54
logging.info("Successfully logged in to destination account.")
55
+
print("Successfully logged in to destination account.")
46
56
47
57
except Exception as e:
48
58
logging.exception("An error occurred during setup: %s", e)
···
63
73
)
64
74
post_link = response['uri']
65
75
logging.info("Posted to destination Bluesky account successfully: %s", post_link)
76
+
print(f"Posted to destination Bluesky account successfully: {post_link}")
66
77
except Exception as e:
67
78
logging.error("Error posting to destination Bluesky account: %s", e)
68
79
···
79
90
80
91
markov = refresh_dataset(markov, source_posts)
81
92
logging.info("Markov dataset refreshed.")
93
+
print("Markov dataset refreshed.")
82
94
83
95
generate_and_post_example()
84
96
sleep_until_next_refresh(next_refresh)
85
97
86
98
except KeyboardInterrupt:
87
-
logging.info("Exiting on user interrupt.")
99
+
logging.info("Exiting on user interrupt.")
100
+
print("Exiting on user interrupt.")