Skip to content
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

Implement file logging to fat:/ntrboot/ntrboot.log #1

Closed
jason0597 opened this issue Dec 2, 2017 · 2 comments
Closed

Implement file logging to fat:/ntrboot/ntrboot.log #1

jason0597 opened this issue Dec 2, 2017 · 2 comments

Comments

@jason0597
Copy link
Owner

No description provided.

@jason0597
Copy link
Owner Author

this seems to be the final thing before release!

@jason0597
Copy link
Owner Author

jason0597 commented Dec 2, 2017

Here's the theory for the code:

=================================================================
The basic principle is that we have this vector that will contain nothing but std::string in it

We will write our logMessage so that upon each call, the vector is expanded by one, and the string sent to this function (logMessage), is parsed
from const char* to std::string and then stored in our vector (which was expanded previously to fit this)

In the end of all this, we must write our entire vector to ntrboot.log, and we can achieve this by writing a new function called writeBufferLog()
which is called immediately after a flashcart_core function call from menu.cpp (either cart->initialize, InjectFIRM or DumpFlash)

logMessage is called, I don't even know how many times, and with each call, a new line is created as well

So, every time we call a flashcart_core function (3 times in total: cart->initialize, InjectFIRM and DumpFlash), we will
immediately follow it by writeBufferLog()

The hardest part of all this is figuring out how va_list works. I must learn how to grab all the unknown number of parameters,
and combine them together in one solid packaged std::string to give to std::vector.

This may or may not work. The trickiest parts are string formatting (%d, %s and all that) everything properly to our std::string
by using asprintf()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant