mirror of https://github.com/ppy/osu
Display Important/Error logging in notifications for now.
This commit is contained in:
parent
580584a015
commit
753232533a
|
@ -25,6 +25,7 @@
|
|||
using System.Linq;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using System.Collections.Generic;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
|
@ -130,6 +131,16 @@ protected override void LoadComplete()
|
|||
Origin = Anchor.TopRight,
|
||||
}).Preload(this, overlayContent.Add);
|
||||
|
||||
Logger.NewEntry += entry =>
|
||||
{
|
||||
if (entry.Level < LogLevel.Important) return;
|
||||
|
||||
notificationManager.Post(new SimpleNotification
|
||||
{
|
||||
Text = $@"{entry.Level}: {entry.Message}"
|
||||
});
|
||||
};
|
||||
|
||||
Dependencies.Cache(options);
|
||||
Dependencies.Cache(musicController);
|
||||
Dependencies.Cache(notificationManager);
|
||||
|
|
Loading…
Reference in New Issue