Skip to content

Commit

Permalink
include ini and clean up log
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengSun committed Jun 30, 2024
1 parent ee47160 commit 939688f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include pygeoweaver/*.sh
include pygeoweaver/*.bat
include pygeoweaver/*.ini
15 changes: 2 additions & 13 deletions pygeoweaver/runtime_tags/pgw_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,20 @@ def geoweaver_process(func):
@wraps(func)
def wrapper(*args, **kwargs):
func_name = func.__name__
print(f"geoweaver tag captured {func_name}")
current_file = inspect.getfile(inspect.currentframe())
current_file = os.path.basename(current_file)
current_file_without_extension = os.path.splitext(current_file)[0]
print(f"Current file name without extension: {current_file_without_extension}")
print(f"Current file name: {current_file}")
try:
# Capture the source code of the wrapped function
func_code = inspect.getsource(func)
except OSError:
func_code = f"# Source code not available for {func_name}"

geoweaver_process_id = f"{current_file_without_extension}.{func_name}"
print("this process id should be unique: ", geoweaver_process_id)

# with open(f"{LOG_DIR}/{func_name}_code.py", "w") as code_file:
# code_file.write(func_code)

#log_file_path = get_log_file_path(func_name)
#logging.basicConfig(filename=log_file_path, level=logging.INFO, filemode='w')
#logger = logging.getLogger(func_name)
logger.info("this process id should be unique: %s", geoweaver_process_id)

# Capture logging output
logger.info(f"Starting {func_name}")
print(f"geoweaver captured {func_name}")
logger.info(f"geoweaver captured {func_name}")

# Capture console output
captured_stdout = io.StringIO()
Expand Down

0 comments on commit 939688f

Please sign in to comment.