mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
get rid of logs volume
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import logging
|
||||
|
||||
|
||||
class FileFormatter(logging.Formatter):
|
||||
level: str = "%(levelname)s"
|
||||
dots: str = ":"
|
||||
identifier: str = "\t [RomM]"
|
||||
identifier_warning: str = " [RomM]"
|
||||
identifier_critical: str = " [RomM]"
|
||||
msg: str = "%(message)s"
|
||||
date: str = "[%(asctime)s] "
|
||||
FORMATS: dict = {
|
||||
logging.DEBUG: level + dots + identifier + date + msg,
|
||||
logging.INFO: level + dots + identifier + date + msg,
|
||||
logging.WARNING: level + dots + identifier_warning + date + msg,
|
||||
logging.ERROR: level + dots + identifier + date + msg,
|
||||
logging.CRITICAL: level + dots + identifier_critical + date + msg
|
||||
}
|
||||
|
||||
def format(self, record):
|
||||
log_fmt = self.FORMATS.get(record.levelno)
|
||||
formatter = logging.Formatter(fmt=log_fmt, datefmt='%Y-%m-%d %H:%M:%S')
|
||||
return formatter.format(record)
|
||||
@@ -1,20 +1,8 @@
|
||||
import logging
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Final
|
||||
|
||||
from config import ROMM_BASE_PATH
|
||||
from logger.file_formatter import FileFormatter
|
||||
from logger.stdout_formatter import StdoutFormatter
|
||||
|
||||
LOGS_BASE_PATH: Final = f"{ROMM_BASE_PATH}/logs"
|
||||
|
||||
# Create logs folder if not exists
|
||||
Path(LOGS_BASE_PATH).mkdir(parents=True, exist_ok=True)
|
||||
now = datetime.now()
|
||||
logs_file = f"{LOGS_BASE_PATH}/{now.strftime('%Y%m%d_%H%M%S')}.log"
|
||||
|
||||
# Get logger
|
||||
log = logging.getLogger("romm")
|
||||
log.setLevel(logging.DEBUG)
|
||||
@@ -24,10 +12,5 @@ stdout_handler = logging.StreamHandler(sys.stdout)
|
||||
stdout_handler.setFormatter(StdoutFormatter())
|
||||
log.addHandler(stdout_handler)
|
||||
|
||||
# Define file handler
|
||||
file_handler = logging.FileHandler(logs_file)
|
||||
file_handler.setFormatter(FileFormatter())
|
||||
log.addHandler(file_handler)
|
||||
|
||||
# Hush passlib warnings
|
||||
logging.getLogger("passlib").setLevel(logging.ERROR)
|
||||
|
||||
@@ -163,7 +163,7 @@ FROM scratch
|
||||
COPY --from=production-stage / /
|
||||
|
||||
# Declare the supported volumes
|
||||
VOLUME ["/romm/resources", "/romm/library", "/romm/assets", "/romm/logs", "/romm/config", "/redis-data"]
|
||||
VOLUME ["/romm/resources", "/romm/library", "/romm/assets", "/romm/config", "/redis-data"]
|
||||
|
||||
# Expose ports and start
|
||||
EXPOSE 8080
|
||||
|
||||
@@ -26,7 +26,6 @@ services:
|
||||
- /path/to/library:/romm/library # Your game library
|
||||
- /path/to/assets:/romm/assets # Uploaded saves, states, etc.
|
||||
- /path/to/config:/romm/config # [Optional] Path where config.yml is stored
|
||||
- /path/to/logs:/romm/logs # [Optional] Path where logs are stored
|
||||
ports:
|
||||
- 80:8080
|
||||
depends_on:
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
<Config Name="Library" Target="/romm/library/" Default="/romm/library" Mode="rw" Description="Game files" Type="Path" Display="always" Required="true" Mask="false"/>
|
||||
<Config Name="Resources" Target="/romm/resources/" Default="" Mode="rw" Description="Metadata storage (covers, screenshots, etc.)" Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/romm/resources</Config>
|
||||
<Config Name="Assets" Target="/romm/assets/" Default="" Mode="rw" Description="Uploaded saves, states, etc." Type="Path" Display="always" Required="true" Mask="false">/mnt/user/appdata/romm/assets</Config>
|
||||
<Config Name="Logs" Target="/romm/logs" Default="" Mode="rw" Description="Log file storage" Type="Path" Display="always" Required="false" Mask="false">/mnt/user/appdata/romm/logs</Config>
|
||||
<Config Name="IGDB_CLIENT_ID" Target="IGDB_CLIENT_ID" Default="" Mode="" Description="IGDB Client ID" Type="Variable" Display="always" Required="true" Mask="false"/>
|
||||
<Config Name="IGDB_CLIENT_SECRET" Target="IGDB_CLIENT_SECRET" Default="" Mode="" Description="IGDB Client Secret" Type="Variable" Display="always" Required="true" Mask="true"/>
|
||||
<Config Name="DB_HOST" Target="DB_HOST" Default="mariadb" Mode="" Description="Database host" Type="Variable" Display="advanced" Required="true" Mask="false"/>
|
||||
|
||||
Reference in New Issue
Block a user