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

Better logging - more colors, less duplication #306

Merged
merged 2 commits into from
Jun 3, 2019

Conversation

roblabla
Copy link
Member

@roblabla roblabla commented May 23, 2019

Brings three improvements:

  • Puts some color on the log level, which is neat
  • Allows filtering of logs coming from userspace applications in grub. We can now do sunrise_clock=debug,info to get more debug information from sunrise_clock, for instance.
  • Makes the outputDebugString aware of the log formatting, which results in logs that look like the following:
[INFO] - sunrise_clock - clock - 13:59:48 Thursday 23 May 19

instead of the old:

[INFO] - sunrise_kernel::interrupts::syscalls - clock - [INFO] - sunrise_clock - 13:59:48 Thursday 23 May 19

Copy link
Member

@Orycterope Orycterope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great !

However, I don't see the code that handles filtering from grub arguments.
How are the arguments passed ? Args of the kernel ? Args of grub modules ?

It would be nice also to update all output_debug_string calls to new log!() syntax in this PR.

@Orycterope
Copy link
Member

And if by any chance you figure out why colors end up fucking up the terminal it would be pretty great.

@roblabla
Copy link
Member Author

roblabla commented May 24, 2019

However, I don't see the code that handles filtering from grub arguments.

It's implemented by virtue of going through the log! function (where we pass the target):
https://github.com/sunriseos/SunriseOS/pull/306/files#diff-cb4690a69ea17d472dcf59b6d931b36aR224

You put the filtering in the args of the kernel. Basically, multiboot2 /boot/sunrise-bootstrap "sunrise_clock=debug,info" will do what you'd expect.

It would be nice also to update all output_debug_string calls to new log!() syntax in this PR.

I did? If I missed any, it'd cause compilation errors since output_debug_string changed signature.

And if by any chance you figure out why colors end up fucking up the terminal it would be pretty great.

wdym? The colors work great on my end:

@roblabla roblabla force-pushed the feature-better-logging branch from e6cefa6 to ad680cd Compare May 27, 2019 15:52
@roblabla roblabla force-pushed the feature-better-logging branch from 5fe3a38 to f8ff51f Compare June 3, 2019 16:34
@roblabla roblabla merged commit 8dba977 into sunriseos:master Jun 3, 2019
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

Successfully merging this pull request may close these issues.

3 participants