Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion checks/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,6 @@ def checkLinuxSystemInfo(lines):
desktopEnvironment = 'None'
linuxSystemInfoHelp += '<br>No Desktop Environment detected. This can lead to undefined behavior. Please consult your Desktop Environment\'s or Window Manager\'s support channels on how to fix this.'

return [logLevel, linuxDistroOrFlatpak + ' | ' + displayServer + ' | ' + desktopEnvironment, linuxSystemInfoHelp]
if logLevel == LEVEL_WARNING:
linuxDistroOrFlatpak = 'Warning: ' + linuxDistroOrFlatpak
return [LEVEL_SYSTEM, linuxDistroOrFlatpak + ' | ' + displayServer + ' | ' + desktopEnvironment, linuxSystemInfoHelp]
6 changes: 3 additions & 3 deletions checks/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ def checkMacVer(lines):
if (int(verinfo["major"]) <= 10 and "max" in verinfo):
msg = "You are running %s %s, which is multiple versions out of date and no longer supported by Apple or recent OBS versions. We recommend updating to the latest macOS release to ensure continued security, functionality and compatibility." % (mv, html.escape(verinfo["name"]))
mv += " (EOL)"
return [LEVEL_WARNING, mv, msg]
return [LEVEL_SYSTEM, "Warning: " + mv, msg]
except (ValueError, OverflowError):
pass

if "latest" in verinfo:
msg = "You are running %s %s, which is currently supported by Apple and the most recent version of OBS." % (mv, html.escape(verinfo["name"]))
mv += " (OK)"
return [LEVEL_INFO, mv, msg]
return [LEVEL_SYSTEM, mv, msg]

msg = "You are running %s %s, which is not officially supported by Apple but is compatible with the most recent version of OBS. Updating to a more recent version of macOS is recommended to ensure that you are able to install future versions of OBS." % (mv, html.escape(verinfo["name"]))
mv += " (OK)"
return [LEVEL_INFO, mv, msg]
return [LEVEL_SYSTEM, mv, msg]


def checkRosettaTranslationStatus(lines):
Expand Down
45 changes: 45 additions & 0 deletions checks/system.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import html
import re

from .vars import *
from .utils.utils import *


def checkCPUInfo(lines):
for label in ('CPU Name:', 'Processor:'):
cpuLines = search(label, lines)
for line in cpuLines:
name = line.split(label, 1)[1].strip()
if not name or (label == 'Processor:' and name.endswith(' logical cores')):
continue

name = html.escape(name)
return [LEVEL_SYSTEM, "CPU: " + name,
"CPU reported by OBS: " + name + "."]


def checkGPUInfo(lines):
gpuLines = search('Loading up ', lines)
for line in reversed(gpuLines):
if 'Loading up D3D11 on adapter' not in line and 'Loading up OpenGL on adapter' not in line:
continue

name = line.split(' on adapter', 1)[1].strip()
if 'Loading up D3D11' in line:
name = re.sub(r'(^|\s+)\(\d+\)$', '', name).strip()
if not name:
continue

name = html.escape(name)
return [LEVEL_SYSTEM, "GPU: " + name,
"Adapter selected for OBS rendering: " + name + "."]


def checkRAMInfo(lines):
memoryLines = search('Physical Memory:', lines)
for line in memoryLines:
match = re.search(r'Physical Memory:\s*([0-9]+)\s*MB\s+Total\b', line)
if match:
total = match.group(1)
return [LEVEL_SYSTEM, "RAM: " + total + " MB",
"Total physical memory reported by OBS: " + total + " MB."]
1 change: 1 addition & 0 deletions checks/vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
LEVEL_WARNING = 2
LEVEL_CRITICAL = 3
LEVEL_NONE = 4
LEVEL_SYSTEM = 5

cleanLog = "<br>To make a clean log file, please follow these steps: <br><br>1) Restart OBS. <br>2) Start your stream/recording for about 30 seconds. Make sure you replicate any issues as best you can, which means having any games/apps open and captured, etc. <br>3) Stop your stream/recording. <br>4) Select Help > Log Files > Upload Current Log File. Send that link via this troubleshooting tool or whichever support chat you are using."
8 changes: 4 additions & 4 deletions checks/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,17 @@ def checkWindowsVer(lines):
if verinfo["build"] > 22000:
msg = "You are running Windows 11 Insider build %d. Some checks that are applicable only to specific Windows versions will not be performed. Also, because Insider builds are test versions, you may have problems that would not happen with release versions of Windows 11." % (
verinfo["build"])
return [LEVEL_WARNING, "Windows 11 Insider Build", msg]
return [LEVEL_SYSTEM, "Warning: Windows 11 Insider Build", msg]
else:
msg = "You are running an unknown Windows 10 release (build %d), which means you are probably using an Insider build. Some checks that are applicable only to specific Windows versions will not be performed. Also, because Insider builds are test versions, you may have problems that would not happen with release versions of Windows." % (
verinfo["build"])
return [LEVEL_WARNING, "Windows 10 Version Unknown", msg]
return [LEVEL_SYSTEM, "Warning: Windows 10 Version Unknown", msg]

if "EoS" in verinfo and datetime.date.today() > verinfo["EoS"]:
wv = "%s (EOL)" % (html.escape(verinfo["name"]))
msg = "You are running %s, which has not been supported by Microsoft since <strong>%s</strong>. We recommend updating to the latest Windows release to ensure continued security, functionality, and compatibility." % (
html.escape(verinfo["name"]), verinfo["EoS"].strftime("%B %Y"))
return [LEVEL_WARNING, wv, msg]
return [LEVEL_SYSTEM, "Warning: " + wv, msg]

# our windows version isn't out of support, so just say what version the user has and when
# it actually does go out of support
Expand All @@ -318,7 +318,7 @@ def checkWindowsVer(lines):
msg = "You are running %s, for which Microsoft has not yet announced an end of life date." % (
html.escape(verinfo["name"]))

return [LEVEL_INFO, wv, msg]
return [LEVEL_SYSTEM, wv, msg]


def checkWindowsARM64(lines):
Expand Down
15 changes: 15 additions & 0 deletions loganalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from checks.network import *
from checks.plugins import *
from checks.sources import *
from checks.system import *
from checks.linux import *
from checks.windows import *

Expand All @@ -34,16 +35,20 @@ def getSummary(messages):
critical = []
warning = []
info = []
system = []
for i in messages:
if (i[0] == LEVEL_CRITICAL):
critical.append(i[1])
elif (i[0] == LEVEL_WARNING):
warning.append(i[1])
elif (i[0] == LEVEL_INFO):
info.append(i[1])
elif (i[0] == LEVEL_SYSTEM):
system.append(i[1])
summary += "{}Critical: {}\n".format(RED, ", ".join(critical))
summary += "{}Warning: {}\n".format(YELLOW, ", ".join(warning))
summary += "{}Info: {}\n".format(CYAN, ", ".join(info))
summary += "{}System: {}\n".format(BLUE, ", ".join(system))
return summary


Expand Down Expand Up @@ -72,6 +77,13 @@ def getResults(messages):
results += "\n{}{}\n".format(CYAN, i[1])
results += textOutput(i[2])

results += "{} \n".format(RESET)
results += "\nSystem:"
for i in messages:
if (i[0] == 5):
results += "\n{}{}\n".format(BLUE, i[1])
results += textOutput(i[2])

results += "{} \n".format(RESET)
return results

Expand Down Expand Up @@ -128,6 +140,9 @@ def doAnalysis(url=None, filename=None):
messages.append(m)
if (not classic and not crash):
messages.extend([
checkCPUInfo(logLines),
checkGPUInfo(logLines),
checkRAMInfo(logLines),
checkObsVersion(logLines),
checkDual(logLines),
checkAutoconfig(logLines),
Expand Down
28 changes: 25 additions & 3 deletions simplehttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
with open("templates/detail.html", "r") as f: # Grab details page
htmlDetail = f.read()

with open("templates/system-item.html", "r") as f:
htmlSystemItem = f.read()


def checkUrl(url):
"""Check if the incoming URL can be analyzed"""
Expand All @@ -24,6 +27,7 @@ def getSummaryHTML(messages):
critical = ""
warning = ""
info = ""
system = ""
for i in messages:
if (i[0] == 3):
critical = critical + """<p><a href="#""" + \
Expand All @@ -37,13 +41,26 @@ def getSummaryHTML(messages):
info = info + """<p><a href="#""" + \
i[1] + """"><button type="button" class="btn btn-info">""" + \
i[1] + "</button></a></p>\n"
elif (i[0] == 5):
label, value = "OS", i[1]
if value.startswith(("CPU: ", "GPU: ", "RAM: ")):
label, value = value.split(": ", 1)
elif i[2]:
if value.startswith("Warning: "):
label += ' <span class="text-warning" role="img" aria-label="Warning" title="Warning">&#9888;</span>'
value = value.removeprefix("Warning: ")
value = f'<details><summary>{value}</summary>{i[2]}</details>'
system += htmlSystemItem.format(label=label, value=value)
if (len(critical) == 0):
critical = "No critical issues."
if (len(warning) == 0):
warning = "No warnings."
if (len(info) == 0):
info = "-"
return critical, warning, info
if system:
system = ('<section class="my-3" aria-labelledby="system-heading"><h2 id="system-heading" class="h5 mb-2">System</h2>'
'<div class="row mx-n1">' + system + '</div></section>')
return critical, warning, info, system


def getDetailsHTML(messages):
Expand Down Expand Up @@ -85,14 +102,15 @@ def getDescr(messages):
def genFullHtmlResponse(url):
"""Runs an analysis and returns a full HTML page with the response."""
msgs = analyze.doAnalysis(url=url)
crit, warn, info = getSummaryHTML(msgs)
crit, warn, info, system = getSummaryHTML(msgs)
details = getDetailsHTML(msgs)
response = htmlTemplate.format(ph=url,
description="""<a href="{}">{}</a>""".format(
url, getDescr(msgs)),
summary_critical=crit,
summary_warning=warn,
summary_info=info,
summary_system=system,
details=details)
return response

Expand All @@ -105,6 +123,7 @@ def genEmptyHtmlResponse():
summary_critical=no_log,
summary_warning=no_log,
summary_info=no_log,
summary_system="",
details="""<p class="text-warning">""" + no_log + """</p>""")
return response_body

Expand All @@ -116,6 +135,7 @@ def genJsonResponse(url, detailed):
critical = []
warning = []
info = []
system = []
for i in msgs:
entry = i[1]
if detailed:
Expand All @@ -126,7 +146,9 @@ def genJsonResponse(url, detailed):
warning.append(entry)
elif (i[0] == 1):
info.append(entry)
return {"critical": critical, "warning": warning, "info": info}
elif (i[0] == 5):
system.append(entry)
return {"critical": critical, "warning": warning, "info": info, "system": system}


def sync_request_handler(request):
Expand Down
7 changes: 4 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ <h1>OBS Log Analyzer</h1>
</form>
</div>
</div>
{summary_system}
<div class="row mb-3">
<div class="col-lg-12">
<div class="page-header">
Expand All @@ -55,23 +56,23 @@ <h2 id="output">Log Analysis <small class="text-muted">of "{description}"</small
</div>
<div class="row">
<div class="col">
<div class="card text-white border-danger mb-3" style="max-width: 20rem;">
<div class="card text-white border-danger mb-3">
<h5 class="card-header">Critical</h5>
<div class="card-body">
{summary_critical}
</div>
</div>
</div>
<div class="col">
<div class="card text-white border-warning mb-3" style="max-width: 20rem;">
<div class="card text-white border-warning mb-3">
<h5 class="card-header">Warning</h5>
<div class="card-body">
{summary_warning}
</div>
</div>
</div>
<div class="col">
<div class="card text-white border-info mb-3" style="max-width: 20rem;">
<div class="card text-white border-info mb-3">
<h5 class="card-header">Info</h5>
<div class="card-body">
{summary_info}
Expand Down
8 changes: 8 additions & 0 deletions templates/system-item.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="col-6 col-lg px-1 mb-2">
<div class="card border-secondary h-100">
<dl class="card-body p-2 mb-0">
<dt class="small text-light">{label}</dt>
<dd class="card-text">{value}</dd>
</dl>
</div>
</div>