-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some features/fixes #6
Changes from 5 commits
6ea5fc9
bbba7ba
5b0366c
44c1ecc
850ad66
7a5487c
c5a1cc5
edc6620
d0afe72
fce76de
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Net; | ||
using System.Runtime.Serialization; | ||
|
||
namespace CLRDEV9.Config | ||
{ | ||
[DataContract(Namespace = "http://schemas.datacontract.org/2004/07/CLRDEV9")] | ||
class ConfigLogging | ||
{ | ||
[DataMember] | ||
public bool Error = true; | ||
[DataMember] | ||
public bool Verbose = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verbose should default to false to match release build behaviour. |
||
[DataMember] | ||
public bool Information = true; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2,6 +2,7 @@ | |||||
using System.Collections.Generic; | ||||||
using System.Diagnostics; | ||||||
using System.IO; | ||||||
using CLRDEV9; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the reference to CLRDEV9 as it's not needed. |
||||||
|
||||||
namespace PSE | ||||||
{ | ||||||
|
@@ -174,7 +175,13 @@ public static void Close() | |||||
|
||||||
public static void WriteLine(TraceEventType eType, int logSource, string str) | ||||||
{ | ||||||
if (sources == null) return; | ||||||
if (sources == null) | ||||||
return; | ||||||
if (DEV9Header.config != null) | ||||||
if ((!DEV9Header.config.EnableLogging.Error && eType == TraceEventType.Error) || | ||||||
(!DEV9Header.config.EnableLogging.Verbose && eType == TraceEventType.Verbose) || | ||||||
(!DEV9Header.config.EnableLogging.Information && eType == TraceEventType.Information)) | ||||||
return; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently, logging is configured with Line 27 in 2795c6e
Note that You can call Also you must allow TraceEventType.Critical to log to stderr and the log file, this level is only used here in the event of a fatal error. CLR-DEV9/CLR_DEV9/PSE/CLR_PSE_PluginLog.cs Line 188 in 2795c6e
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really sure how I should handle this, because as you said, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't used VSCode much myself, but I've made build tasks that should allow you to create release builds. (You will need to open the solution folder instead of the project folder is vscode to use the tasks) You could either move any calls to Ideally I would like to be able to enable Verbose logging on a per source level as just one source can produce a large amount entries, although the need for verbose logs doesn't come up often. |
||||||
if (sources.ContainsKey(logSource)) | ||||||
{ | ||||||
sources[logSource].TraceEvent(eType, logSource, str); | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(clrdev9) | ||
|
||
add_library(${PROJECT_NAME} SHARED | ||
coreclrhost.h | ||
DEV9.h | ||
DEV9.cpp | ||
PSE.h | ||
PSE.cpp | ||
) | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32") | ||
target_link_libraries(${PROJECT_NAME} | ||
m | ||
rt | ||
dl | ||
pthread | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
#include <fcntl.h> | ||
#include <sys/types.h> | ||
#include <sys/stat.h> | ||
#include <pwd.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove reference if this is no-longer required. |
||
|
||
#include <set> | ||
#include <vector> | ||
|
@@ -303,8 +304,11 @@ void LoadCoreCLR(string pluginPath, string coreClrFolder) | |
|
||
if (coreClrFolder.length() == 0) | ||
{ | ||
//coreClrFolder = "/home/air/git/ReadyBin.Release"; | ||
coreClrFolder = "/home/air/git/ReadyBin.Debug"; | ||
const char *homedir = getenv("HOME"); | ||
if ( homedir == NULL ) { | ||
homedir = getpwuid(getuid())->pw_dir; | ||
} | ||
coreClrFolder = string(homedir) + string("/.config/PCSX2/coreclr"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CLR_DEV9_CORE.dll is currently found bases on the path passed to |
||
} | ||
|
||
string coreClrPath = coreClrFolder + "/" + "libcoreclr.so"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do ConfigLogging's defaults apply correctly when loading an older config file (that lacks the entry)?
I remember having issues relating to that in the past.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If config file lacks the entry, it applies default values. (at least on my machine)
However, if you manually add required entries, it still applies default values until you let it recreate config file. (maybe I just did it in wrong order?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the entries in the file have to be in a specific order for settings to be read. I'm only concerned about updating an old file, and that seems to work.