File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,6 +59,23 @@ def configure():
5959 print (f"export GOOGLE_ADS_CONFIGURATION_FILE_PATH=\" { target_yaml } \" " , file = sys .stdout )
6060
6161if __name__ == "__main__" :
62+ log_file = os .path .expanduser ("~/gemini_hook_log.txt" )
63+ timestamp = datetime .datetime .now ().isoformat ()
64+ try :
65+ with open (log_file , "a" ) as f :
66+ f .write (f"SessionStart HOOK: custom_config_python.py ran at { timestamp } \n " )
67+ print ("DEBUG: custom_config_python.py wrote to log" , file = sys .stderr )
68+ except Exception as e :
69+ # Try to print error to stderr, in case it's visible
70+ print (f"DEBUG: custom_config_python.py ERROR: { e } " , file = sys .stderr )
71+ # Also write error to the log file
72+ try :
73+ with open (log_file , "a" ) as f :
74+ f .write (f"SessionStart HOOK ERROR: { timestamp } - { e } \n " )
75+ except :
76+ pass # Oh well, we tried
77+ sys .stderr .flush ()
78+
6279 timestamp = datetime .datetime .now ()
6380 message = f"SUCCESS: SessionEnd hook 'cleanup_config.py' ran at { timestamp } "
6481 print (message , file = sys .stderr )
You can’t perform that action at this time.
0 commit comments