Giter Site home page Giter Site logo

Comments (15)

grokys avatar grokys commented on May 5, 2024

I'm seeing this problem as well.

from splat.

anaisbetts avatar anaisbetts commented on May 5, 2024

Yeah, I know :( An overhaul of Splat logging is definitely on the table for 2.0, because what we've got in 1.0 sucks out loud

from splat.

grokys avatar grokys commented on May 5, 2024

Glad you said that, because I was just about to go write my own, and that's a rabbit hole I really don't want to have to go down... I'll wait in anticipation.

from splat.

moswald avatar moswald commented on May 5, 2024

@grokys, it's trivial to add your own debug logger. I think I copied mine directly from the Splat source:

    public class LogImpl : ILogger
    {
        public void Write(string message, LogLevel logLevel)
        {
            if ((int)logLevel < (int)Level)
            {
                return;
            }

            Debug.WriteLine(message);
        }

        public LogLevel Level { get; set; }
    }

And then you just add it as an instance of the ILogger in your Locator:

Locator.CurrentMutable.RegisterConstant(new LogImpl { }, typeof(ILogger));

from splat.

grokys avatar grokys commented on May 5, 2024

@moswald - yeah, I've already done that, but there are various other problems with the logging framework I'm having to work around too such as #41.

from splat.

anaisbetts avatar anaisbetts commented on May 5, 2024

@grokys What would you add? I have ideas but I definitely want to hear others.

One thing that motivates me to write my own instead of using the legion of others, is that most loggers give zero thought to perf concerns on mobile devices - they're all written for servers, so none of them think about CPU perf or allocations. The best imho is Serilog, but it allocates way too much stuff imho to be usable on mobile

from splat.

grokys avatar grokys commented on May 5, 2024

Well, the things I would add if I were to roll my own may be a little specific to my particular problem (https://github.com/grokys/Perspex/).

  • I'd be able to filter by individual object/type. So when I'm debugging a TreeView I'd be able to log only messages from TreeViews, or only a particular instance. This would be configured at runtime.
  • I'd have categories that spanned multiple classes, (e.g. "Styling", "Layout" etc rather than by individual class) and be able to filter by this.

The main reason I'm using Splat's logger is simply that I'm used to using RxUI and I need a logger and service locator, so splat made sense.

from splat.

ghuntley avatar ghuntley commented on May 5, 2024

See also #123 and #58

from splat.

Belorus avatar Belorus commented on May 5, 2024

@paulcbetts Please have a look at XLog - https://github.com/Belorus/XLog/wiki if you care about logging performance.
Basically the most important thing to care of was memory traffic. Reducing heap allocations to 1 allocation per log entry allowed to beat everything we have in nuget

from splat.

ghuntley avatar ghuntley commented on May 5, 2024

@Belorus would you be interested in rewriting our implementation instead of having to maintain xlog?

from splat.

Belorus avatar Belorus commented on May 5, 2024

@ghuntley, sure, i can try. Would be pleasure if it will save few milliseconds for more people. I'll get in touch with PR in a week with results

from splat.

ghuntley avatar ghuntley commented on May 5, 2024

@Belorus just make sure you open a discussion / WIP with your changes early before storming ahead.

from splat.

cabauman avatar cabauman commented on May 5, 2024

Copying that snippet from @moswald's comment worked for me (adding our own logger implementation). Wasn't getting anything in the output window, otherwise. Thanks.

from splat.

ghuntley avatar ghuntley commented on May 5, 2024

This knowledge has been documented over at https://reactiveui.net/docs/guidelines/debugging/enable-framework-logging 🚢

from splat.

cabauman avatar cabauman commented on May 5, 2024

Thanks @ghuntley but I've already tried that section of the documentation before. That page, among a few others, are blank.

EDIT: Okay, that page isn't blank anymore. Thanks again ghuntley.

enable_logging_framework_blank1

from splat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.