npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

anylogger-diary

v0.0.1

Published

Anylogger adapter for Diary

Downloads

4

Readme

anylogger-diary 0.0.1

Anylogger adapter for Diary

npm license travis mind BLOWN

.

DONT USE NOT READY YET

..

What is this?

This is an anylogger adapter for Diary.

This package is meant for application projects that are using libraries using anylogger. By including this adapter in your project, all libraries using anylogger will automatically start to use Diary as their logging framework.

Download

CDN

index.html

<script src="https://unpkg.com/[email protected]/anylogger.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/diary.min.js"></script>
<script src="https://unpkg.com/[email protected]/anylogger-diary.min.js"></script>
<script>(function(){ // IIFE
  var log = anylogger('index.html')
  log.info('Logging is simple!')
  // to see logging, enable it by typing this in the console:
  // localStorage.setItem('diary:index.html', 'DEBUG')
  // then refresh the page
})()</script>

Install

Install this adapter, as well as both anylogger and Diary:

npm install --save anylogger-diary anylogger diary

Include in your application project

This package is meant for application projects. If you are writing a library to be NPM installed into some other project, most likely you should not include any adapter, but instead just use anylogger directly.

The anylogger-diary adapter will modify the anylogger factory in such a way that the loggers it creates will be logging to diary.

When using diary, all logging except for warnings and errors is supressed by default. As such, you should make sure to set the log level to INFO or DEBUG as usual before expecting to see any output.

To activate the adapter, include it in your application entry point.

Require

main.js

require('anylogger-diary')

Import

main.js

import 'anylogger-diary'

Logging in the application project

In your application module code, only use anylogger to stay framework independent:

my-module.js

import anylogger from 'anylogger'
const log = anylogger('my-module')
log('Logging is simple!')

This is helpful if you ever decide to factor out the application module into a separate library.

log configuration in the application project

Because anylogger is simply using diary below the surface, you can use all the normal configuration mechanisms available for diary.

If you need to control log settings programmatically, just import diary and use it directly:

main.js

// ...
import diary from 'diary'
diary.getLogger('my-module').setLevel(diary.levels.INFO)
// ...

Issues

Add an issue in this project's issue tracker to let me know of any problems you find, or questions you may have.

License

Licensed under the MIT Open Source license.

gzip-size

The GZIP algorithm is available in different flavours and with different possible compression settings. The sizes quoted in this README have been measured using gzip-size by Sindre Sorhus, your mileage may vary.