No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    loglevel implemention - thoughts?

    Framework
    1
    1
    115
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jeffatpf last edited by

      All, I’ve implemented loglevel - https://github.com/pimterry/loglevel - within my Quasar application.

      Here’s my very simple boot file:

      import loglevel from 'loglevel';
      
      const isDevelopment = process.env.NODE_ENV === 'development';
      loglevel.setLevel(isDevelopment ? 'debug' : 'error', false);
      
      window.console = loglevel;
      

      So, all I’m doing is swapping out the window.console for loglevel. It works great in my application, I can use console.log(), console.error(), and all of the other console functions. Messages are filtered by environment and the module supports a bunch of other nice stuff (like plugins).

      Is this a satisfactory way to implement this module?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post