Open jdetter opened 8 years ago
Reference: #5
After giving this quite a bit more thought, I think we should also try to move towards file logging. I think that the amount of debug output coming to the screen should be kept to a minimum but it doesn't really matter too much if we dump a ton of logs to disk. However, a way to change the level of verboseness of the logging to disk should also be available.
One huge factor for this is that console output is kind of useless if the system crashes, which it's nice to be able to debug crashes =D
If this could be incorporated into #5 that would be really cool to see.
Sounds good,
Yeah this definitely should be merged in the same effort. Or at least the design thought should be put into it. I think we could probably mux the DEBUG statements into an actual log and or log writing service.
I'm picturing that we'd like to have this log being written, at least at some level, even when debug is disabled. Is that what you were thinking as well John? Or, even more so have conditional defines just like we do for normal logging to say what level/systems to log?
And then a couple concerns with this are that the log writing portion might make this a lot more difficult to use. For instance, early code before the filesystem is loaded will likely need to be compiled differently? Or more likely the logging library will need to be written in a way that it can start solely in memory. This would no longer be a simple header we are importing and being wrapped around the printk.
Additionally I think this library might get a little awkward to end up using without a configuration system. For instance we now would like to be able to define a console logging level/systems, and the same for the physical log. And we might like to enable one w.o the other. I don't have any issues with that desire, but manually defining flags for those could be tedious or confusing. We definitely need to look at getting a config/build system up. Sorry to keep bringing up that issue :3 It's definitely going to be a bitch of a project.
yeah I would just do conditional defines unless we had a build system where you could turn on or off different debugging levels with flags.
Right now, we have support for logging to disk but it's only used for the terminal windows towards the end of the boot. devman
, fsman
, disk drivers and the ext2 file system driver need to be initilized before any logging happens.
I think we could still do this as a macro, it will be more complicated for sure.
And yes I agree, this should probably wait until we have #7 figured out.
The debugging system is really crufty right now and has a lot of room for improvement.