from eizen_utils.logger_utils.logger_operations import LoggerOperations def log_with_all_defaults(): logger = LoggerOperations() logger.info("1. All default settings: logger_name, log_file_name, log_directory") def log_with_custom_logger_name(): logger = LoggerOperations(logger_name="customLoggerName") logger.debug("2. Custom logger name only") def log_with_custom_log_file_name(): logger = LoggerOperations(log_file_name="custom_file.log") logger.warning("3. Custom log file name only") def log_with_custom_log_directory(): logger = LoggerOperations(log_directory="logs/tmp/custom_logs") logger.error("4. Custom log directory only") def log_with_custom_name_and_file(): logger = LoggerOperations(logger_name="combinedLogger", log_file_name="combined.log") logger.info("5. Custom logger name and log file name") def log_with_all_custom_settings(): logger = LoggerOperations( logger_name="fullCustomLogger", log_file_name="full_custom.log", log_directory="logs/tmp/full_custom_logs" ) logger.critical("6. All custom values: name, file, directory") def view_filtered_logs(): logger = LoggerOperations() logs = logger.get_logs(level="INFO") print("\n--- Filtered INFO logs ---") for log in logs: print(log) def view_logs_with_time_range(): logger = LoggerOperations() logs = logger.get_logs( level="DEBUG", start_time="2025-06-01 10:00:00", end_time="2025-06-01 12:00:00" ) print("\n--- Filtered DEBUG logs between 10:00 and 12:00 ---") for log in logs: print(log) if __name__ == "__main__": # log_with_all_defaults() # log_with_custom_logger_name() # log_with_custom_log_file_name() log_with_custom_log_directory() # log_with_custom_name_and_file() # log_with_all_custom_settings() # view_filtered_logs() # view_logs_with_time_range()