Skip to content

Commit

Permalink
Basic bug fixes, remove frontend loggers.
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMicroNova committed Aug 19, 2024
1 parent 9d547ec commit 8455ece
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 2 additions & 1 deletion amplipi/updater/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def create_logging_ini():
conf.read(file)
conf.add_section("logging")
conf.set("logging", "auto_off_delay", "14")
conf.set('logging', 'log_level', "INFO")
conf.write(file)
subprocess.run(['sudo', 'mv', tmp, ini], check=True)

Expand Down Expand Up @@ -268,7 +269,7 @@ def set_log_level(log_level: LogLevel):
tmp = '/tmp/logging.ini.tmp'
ini = '/var/log/logging.ini'
config = read_config(ini)
config.set("logging", "log_level", str(log_level.log_level))
config.set("logging", "log_level", log_level.log_level.value)
with open(tmp, "w", encoding="utf-8") as file:
config.write(file)

Expand Down
5 changes: 0 additions & 5 deletions amplipi/updater/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ <h1><span class="text-white">Ampli</span><span class="text-danger">Pi</span></h1

timezones.forEach(zone => {
const option = document.createElement("option");
console.log(`zone: ${zone}`)
option.value = zone;
option.textContent = zone;
if(zone == timezone){
Expand Down Expand Up @@ -200,7 +199,6 @@ <h1><span class="text-white">Ampli</span><span class="text-danger">Pi</span></h1

log_levels.forEach(level => {
const option = document.createElement("option");
console.log(`level: ${level}`)
option.value = level;
option.textContent = level;
if(level == log_level){
Expand All @@ -217,9 +215,6 @@ <h1><span class="text-white">Ampli</span><span class="text-danger">Pi</span></h1
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ "log_level": log_level.value })
});
const resp = await response.json()
console.log(`Log level attempted to set to: ${log_level.value}`);
console.log(`Log level actually set to: ${resp}`);
}

function initSettings(){
Expand Down
4 changes: 2 additions & 2 deletions scripts/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@
'sudo systemctl enable systemd-journald.service',
'sudo systemctl restart systemd-journald.service',

'echo "If first deploy, create logging.ini and set default log level to INFO"',
r'[ ! -d /var/log/logging.ini ] && echo -e "[logging]\nlog_level=INFO\n" | sudo tee /var/log/logging.ini',
'echo "If first deploy, create logging.ini and set default values"',
r'[ ! -f /var/log/logging.ini ] && echo -e "[logging]\nauto_off_delay=14\nlog_level=INFO\n" | sudo tee /var/log/logging.ini',

'echo Handle dependencies for log persistence options',
'sudo mkdir -p /var/log/journal',
Expand Down

0 comments on commit 8455ece

Please sign in to comment.