Comment by ajstacy06

Comment by ajstacy06 3 days ago

4 replies

It's universal meaning it works in the web browser and the backend without any configuration. All other loggers work in one or the other, or if they work in both the functionality is severely limited. Winston and Bunyan only work server side because they use node fs streams. Pino is primarily designed to be a server side library, but it can run in the browser by using browserify and using limited funcionality.

Of course console methods are universal. This library isn't providing console methods, it's providing enterprise/production level functionality on top of the console.

If you want to use Winston in Sveltekit or the like, you have to wrap browser checks around parts of it, otherwise it will explode when bundled.

SahAssar 3 days ago

Right, I usually prefer to use the built in console methods with some currying when needed so I might not be the audience. This has worked well enough even for "enterprise" use-cases.

If I may give one suggestion maybe drop the dependency on 'vuepress-plugin-search-pro' (48MB) and maybe 'date-fns' (23MB), that seems like some really large dependencies that might not be required.

  • ajstacy06 3 days ago

    First of all, if that's all you need then by all means, keep doing that. If you need any of the following, maybe consider a library:

    - First-class TypeScript support (not bolted-on)

    - Wraps and extends the entire standard API

    - A convenient chainable API

    - Log Listeners for capturing log data

    - Middleware support for plugins and transporting logs

    - Log annotations such as namespaces, labels, and other meta data

    - Four formats supported out of the box:

      - Pretty - Human readable logs that are easy on the eyes
      
      - JSON - Machine readable logs that are compatible with the Bunyan CLI
      
      - Standard - Human readable stdout logs
      
      - Common - Logs that adhere to the Common Log Format
    
    - Everything is customizable and configurable

    - Tools for caching, filtering, and recalling logs

    - Support for creating log threads to track data across multiple scopes

    - Convenient child logger API's

    If you look at the readme you'll see adze is 8kb bundled and gzipped. It's ESM so it has tree-shaking support. It's tiny. The Vue dependency is for the docs.

    https://bundlephobia.com/package/adze@2.0.10

    • SahAssar 3 days ago

      Install size is 38MB and was 94MB until you moved vuepress-plugin-search-pro to devDependencies (I'm guessing because of my comment?) so even though it might be treeshook to a small size install size is still quite a bit larger to install.

      • ajstacy06 18 hours ago

        Yes, that dependency was there by mistake and has been moved to devDependencies in 2.0.11