RIP-Comm / clementine

Gameboy Advance emulator.
MIT License
49 stars 13 forks source link

Add new logger #115

Closed guerinoni closed 1 year ago

guerinoni commented 1 year ago

Basically the feature is because I would love to analyze the data and istruction post-run of a specific ROM, since now we have enough instruction running but we don't know where are bugs :). This allow us to log on stdout as befor of log on a file saved under /tmp/clementine-{utc::now()}.log with a special arg like ./clementine --log-on-file my_game.gba.

We need to check this path on windows platform.

AlessioC31 commented 1 year ago

Curiosity: aren’t there in rust logging solutions instead of writing our own?

somethin like https://docs.rs/log/latest/log/

so that we could have different levels of logging, for example I imagine a level where we would also get the register dump every instruction and so on

I would also squash first and third commit

guerinoni commented 1 year ago

Curiosity: aren’t there in rust logging solutions instead of writing our own?

somethin like https://docs.rs/log/latest/log/

so that we could have different levels of logging, for example I imagine a level where we would also get the register dump every instruction and so on

I will squash commits... Basically it is enough easy to implement myself, also for personal fun (“What I cannot create, I do not understand.” – Richard Feynman)

Another reason is because this will never be a production application, one day, when it will run it will be finished because there are no other rooms to improve or create new game around it, then we are just creating fun for ourselves :D

AlessioC31 commented 1 year ago

Curiosity: aren’t there in rust logging solutions instead of writing our own? somethin like https://docs.rs/log/latest/log/ so that we could have different levels of logging, for example I imagine a level where we would also get the register dump every instruction and so on

I will squash commits... Basically it is enough easy to implement myself, also for personal fun (“What I cannot create, I do not understand.” – Richard Feynman)

Another reason is because this will never be a production application, one day, when it will run it will be finished because there are no other rooms to improve or create new game around it, then we are just creating fun for ourselves :D

Although I like and enforce Feynman’s quote in my life too (that’s why we’re doing this emulator when there exist thousands already :D), I don’t agree with reimplementing something as standardised as a logging library in a repo where the main focus is something else, because then you need to draw boundaries somewhere: e.g., can person X implement from scratch in clementine a new UI library? Why not? What do we define simple enough to be reimplemented here and what we don’t?

guerinoni commented 1 year ago

Curiosity: aren’t there in rust logging solutions instead of writing our own? somethin like https://docs.rs/log/latest/log/ so that we could have different levels of logging, for example I imagine a level where we would also get the register dump every instruction and so on

I will squash commits... Basically it is enough easy to implement myself, also for personal fun (“What I cannot create, I do not understand.” – Richard Feynman) Another reason is because this will never be a production application, one day, when it will run it will be finished because there are no other rooms to improve or create new game around it, then we are just creating fun for ourselves :D

Although I like and enforce Feynman’s quote in my life too (that’s why we’re doing this emulator when there exist thousands already :D), I don’t agree with reimplementing something as standardised as a logging library in a repo where the main focus is something else, because then you need to draw boundaries somewhere: e.g., can person X implement from scratch in clementine a new UI library? Why not? What do we define simple enough to be reimplemented here and what we don’t?

No blockers from my side, we can implement all from scratch, sure there is enough difference from a single file for logger or entire UI package, but can be interesting re-write a UI specific for our use case :)

AlessioC31 commented 1 year ago

Curiosity: aren’t there in rust logging solutions instead of writing our own? somethin like https://docs.rs/log/latest/log/ so that we could have different levels of logging, for example I imagine a level where we would also get the register dump every instruction and so on

I will squash commits... Basically it is enough easy to implement myself, also for personal fun (“What I cannot create, I do not understand.” – Richard Feynman) Another reason is because this will never be a production application, one day, when it will run it will be finished because there are no other rooms to improve or create new game around it, then we are just creating fun for ourselves :D

Although I like and enforce Feynman’s quote in my life too (that’s why we’re doing this emulator when there exist thousands already :D), I don’t agree with reimplementing something as standardised as a logging library in a repo where the main focus is something else, because then you need to draw boundaries somewhere: e.g., can person X implement from scratch in clementine a new UI library? Why not? What do we define simple enough to be reimplemented here and what we don’t?

No blockers from my side, we can implement all from scratch, sure there is enough difference from a single file for logger or entire UI package, but can be interesting re-write a UI specific for our use case :)

I do like the concept that everyone can code everything from scratch (who am I to say no?) but I just think it should not be under clementine since the repo is for the emulator