Files
common/docs
Jaco Greeff b4c67178a1 Add isError & ExtError (#16)
* Add isError & ExtError

* Check fixes

* Check fixes
2017-11-24 20:49:25 +01:00
..
2017-11-24 20:49:25 +01:00
2017-11-24 20:49:25 +01:00
2017-11-24 20:49:25 +01:00

Available interfaces

Utility methods for this package are split into groups

  • bn Utility methods to convert to and from BN objects
  • buffer Utility methods to convert to and from Buffer objects
  • ext Extensions to basic classes
  • hex Internal utilities to create and test for hex values
  • is Type checking utilities
  • jsonrpc Convenience functions for values from @polkadot/jsonrpc
  • keccak Create Keccak256 values as hex, string & buffer output

Available methods

Logger

Creates a consistent log interface for messages

logger (type: string): Logger

Returns a Logger that has .log, .error and .warn methods. Loggins is done with a consistent prefix (type of logger, date) followed by the actual message uning the underlying console.

const l = require('@polkadot/util/logger')('test');

l.log('blah'); // <date>     TEST: blah