Skip to content

Commit

Permalink
Revert "Fix logging configuration to ensure Cloud Foundry log capture"
Browse files Browse the repository at this point in the history
This reverts commit 274a00d.
  • Loading branch information
collinschreyer-dev committed Nov 13, 2024
1 parent 4524769 commit 3a9d48a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
13 changes: 2 additions & 11 deletions src/fbo_scraper/json_log_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,15 @@ def configure_logger(logger, options, stdout_level=logging.INFO):
"""Configure logger with either JSON or standard formatting"""
logger.handlers = []

# Choose the formatter
# Cleaner options check using DotDict
if options.client.json_logging:
formatter = CustomJsonFormatter()
else:
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')

# Configure handler for the named logger
handler = logging.StreamHandler(sys.stdout)
handler = logging.StreamHandler()
handler.setFormatter(formatter)
handler.setLevel(stdout_level)
logger.addHandler(handler)

# Add this section to configure the root logger
root_logger = logging.getLogger()
if not root_logger.handlers:
root_handler = logging.StreamHandler(sys.stdout)
root_handler.setFormatter(formatter)
root_handler.setLevel(stdout_level)
root_logger.addHandler(root_handler)

return logger
12 changes: 9 additions & 3 deletions src/fbo_scraper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,15 @@ def grab_model_path(options):
"""
Returns the path to the prediction model.
"""
# Use absolute path to the model file in src directory
base_dir = Path(__file__).parent
return str(base_dir / "binaries" / "clf_ajbuckingham_roc_auc.pkl")
model_name = options.prediction.model_name
model_path = options.prediction.model_path
if model_name:
model_path = Path(binary_path, model_name)
elif model_path:
model_path = Path(model_path)
else:
model_path = Path(binary_path, "atc_estimator.pkl")
return model_path

def check_environment():
"""
Expand Down

0 comments on commit 3a9d48a

Please sign in to comment.