lucendio:dlog

multi-platform logging tool; (de-)activatable via CLI (add lucendio:dlog-activated)


License
MIT
Install
meteor add lucendio:dlog@=0.1.1

Documentation

clog

a multi-platform, scopeable, logging/debugging tool, which also provides different kind of levels (e.g. warn, info, error, ...) It's intended to use it with meteor and the packages: dlog & dlog-activated

API

clog( subject [, options] )

subject: anything you want to output (if it isn't already a string, its gets stringifyed right before)

options: Object

  • level: String - info, warn, debug, error, log
  • scope: String - if not defined, the default scope is set to 'global'
clog.scope.specify( scopes )

scopes: String, [String] or undefined

  • (de-)activate (toggle) scopes by inserting them as a parameter
  • if scope(s) were set, the output of global-scoped clog is deactivated. if you want to change that, just add explicitly the global scope with this function
  • calling the function with no argument will resetting the whole scope index to default
  • any time you call this function will deactivate the flood-mode
clog.scope.flood( )
  • force to output every clog (aka flood-mode)
clog.scope.restrict( )
  • deactivate the flood-mode and ensure the output of only with a scope explicitly
clog.scope.list( )
  • returns an Array of activated scopes
clog.mimic( device )

device: String - 'tv', 'tablet', 'mobile' or 'desktop'

  • will only affect the client
  • setting it to something other than 'desktop' get the outputs of all clog appearing within the browser viewport
clog.hideAfter( ms )

ms: Number - milliseconds after the output will disappear

  • will only affect outputs within the browser viewport (mobile, tablet, tv)

Contribution

Any constructive contributions are welcome! If you not sure, if that's the case, get in touch right away. It's always a pleasure to hear from you.

Credits

  • detecting devices is provided by a part of Detectizr
  • detecting origin file:line is provided by a part of the meteor core package: logging

License

MIT