Cleaned up Warning And Error Code
This commit is contained in:
@@ -104,6 +104,18 @@ class Logs {
|
||||
color: color
|
||||
}], level);
|
||||
}
|
||||
|
||||
public inline static function verbose(text:String, level:Level = VERBOSE, color:ConsoleColor = LIGHTGRAY) {
|
||||
Logs.trace(text, level, color);
|
||||
}
|
||||
|
||||
public inline static function warn(text:String, level:Level = WARNING, color:ConsoleColor = YELLOW) {
|
||||
Logs.trace(text, level, color);
|
||||
}
|
||||
|
||||
public inline static function error(text:String, level:Level = ERROR, color:ConsoleColor = RED) {
|
||||
Logs.trace(text, level, color);
|
||||
}
|
||||
}
|
||||
|
||||
enum abstract Level(Int) {
|
||||
|
||||
@@ -71,7 +71,7 @@ class MainState extends FlxState {
|
||||
sys.FileSystem.createDirectory('./.temp/');
|
||||
#if windows
|
||||
try new funkin.backend.utils.native.HiddenProcess("attrib +h .temp")
|
||||
catch(e) Logs.trace('Failed to set hidden attribute on .temp folder', WARNING);
|
||||
catch(e) Logs.warn('Failed to set hidden attribute on .temp folder');
|
||||
#end #end
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class SystemInfo extends FramerateCategory {
|
||||
public static inline function init() {
|
||||
#if linux
|
||||
var process = new HiddenProcess("cat", ["/etc/os-release"]);
|
||||
if (process.exitCode() != 0) Logs.trace('Unable to grab OS Label', ERROR, RED);
|
||||
if (process.exitCode() != 0) Logs.error('Unable to grab OS Label');
|
||||
else {
|
||||
var osName = "";
|
||||
var osVersion = "";
|
||||
@@ -53,7 +53,7 @@ class SystemInfo extends FramerateCategory {
|
||||
if (lime.system.System.platformLabel != null && lime.system.System.platformLabel != "" && lime.system.System.platformVersion != null && lime.system.System.platformVersion != "")
|
||||
osInfo = '${lime.system.System.platformLabel.replace(lime.system.System.platformVersion, "").trim()} ${lime.system.System.platformVersion}';
|
||||
else
|
||||
Logs.trace('Unable to grab OS Label', ERROR, RED);
|
||||
Logs.error('Unable to grab OS Label');
|
||||
#end
|
||||
|
||||
try {
|
||||
@@ -79,7 +79,7 @@ class SystemInfo extends FramerateCategory {
|
||||
}
|
||||
#end
|
||||
} catch (e) {
|
||||
Logs.trace('Unable to grab CPU Name: $e', ERROR, RED);
|
||||
Logs.error('Unable to grab CPU Name: $e');
|
||||
}
|
||||
|
||||
@:privateAccess {
|
||||
@@ -93,24 +93,24 @@ class SystemInfo extends FramerateCategory {
|
||||
if(openfl.display3D.Context3D.__glMemoryTotalAvailable != -1) {
|
||||
var vRAMBytes:UInt = cast(flixel.FlxG.stage.context3D.gl.getParameter(openfl.display3D.Context3D.__glMemoryTotalAvailable), UInt);
|
||||
if (vRAMBytes == 1000 || vRAMBytes == 1 || vRAMBytes <= 0)
|
||||
Logs.trace('Unable to grab GPU VRAM', ERROR, RED);
|
||||
Logs.error('Unable to grab GPU VRAM');
|
||||
else
|
||||
vRAM = CoolUtil.getSizeString(vRAMBytes * 1000);
|
||||
}
|
||||
} else
|
||||
Logs.trace('Unable to grab GPU Info', ERROR, RED);
|
||||
Logs.error('Unable to grab GPU Info');
|
||||
}
|
||||
|
||||
#if cpp
|
||||
totalMem = Std.string(MemoryUtil.getTotalMem() / 1024) + " GB";
|
||||
#else
|
||||
Logs.trace('Unable to grab RAM Amount', ERROR, RED);
|
||||
Logs.error('Unable to grab RAM Amount');
|
||||
#end
|
||||
|
||||
try {
|
||||
memType = MemoryUtil.getMemType();
|
||||
} catch (e) {
|
||||
Logs.trace('Unable to grab RAM Type: $e', ERROR, RED);
|
||||
Logs.error('Unable to grab RAM Type: $e');
|
||||
}
|
||||
formatSysInfo();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user