10 lines
260 B
Python
10 lines
260 B
Python
import psutil
|
|
import logging
|
|
|
|
def log_system_metrics():
|
|
cpu_usage = psutil.cpu_percent(interval=1)
|
|
memory_usage = psutil.virtual_memory().percent
|
|
|
|
logging.info(f'CPU Usage: {cpu_usage}%')
|
|
logging.info(f'Memory Usage: {memory_usage}%')
|