@here/harp-utils
Provides utilities: logging, debugging.
Last updated 16 days ago by here-maps .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @here/harp-utils 
SYNC missed versions from official npm registry.

@here/harp-utils

Overview

This module provides utility classes. Such as, but not limited to:

  • logging
  • caching
  • URL resolving
  • Simple Math

Logger

Custom logger for writing messages to browser console or separate window. Messages could be filtered by log names or completely disabled via URI parameters or UI. Logger name is required and cannot be empty.

import { LoggerManager, LogLevel } from '@here/harp-utils';

const loggerManager = LoggerManager.instance;

// Create named logger and configure it to Warn log level.
const logger: ILogger = loggerManager.create('my logger', {
    level: LogLevel.Warn
});

// Warning 'my logger: something' logged to output.
logger.warn('something...');

// Won't be logged because log level is 'warn'.
logger.log('not logged...');

// Now, message is logged.
logger.level = LogLevel.Log;
logger.log('logged...');

// Be good developer. Free resources after you done.
// Unregister logger from global registry.
loggerManager.dispose(logger);

Current Tags

  • 0.11.0-alpha.0                                ...           alpha (9 months ago)
  • 0.17.0                                ...           latest (16 days ago)

18 Versions

  • 0.17.0                                ...           16 days ago
  • 0.16.0                                ...           a month ago
  • 0.15.0                                ...           2 months ago
  • 0.14.0                                ...           3 months ago
  • 0.13.0                                ...           4 months ago
  • 0.12.0                                ...           5 months ago
  • 0.11.1                                ...           7 months ago
  • 0.11.0                                ...           8 months ago
  • 0.11.0-alpha.0                                ...           9 months ago
  • 0.10.0                                ...           a year ago
  • 0.2.7                                ...           a year ago
  • 0.2.6                                ...           a year ago
  • 0.2.5                                ...           a year ago
  • 0.2.4                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago

Copyright 2014 - 2016 © taobao.org |