Skip to content

Commit

Permalink
cleaning up doc definition formats
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Dec 18, 2017
1 parent 3d10ffb commit c924043
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -81,7 +81,7 @@ wrapped with that same extra sugar.
Please see [`LogLevel`](docs/LogLevel.md) for documentation of all methods and
properties of every log instance, including the default instance.

### `trace`, `debug`, `info`, `warn`, `error`
#### `trace`, `debug`, `info`, `warn`, `error`

These methods correspond to the available log levels and accept parameters
identical to their `console` counterparts. eg.
Expand All @@ -92,12 +92,12 @@ console.info('...');
// ... etc
```

### `getLogger(options)`
#### `getLogger(options)`

Returns a new `LogLevel` instance. The `options` parameter should be an `Object`
matching the options for the [`LogLevel`](docs/LogLevel.md) constructor.

### `noConflict()`
#### `noConflict()`

When using `loglevelnext` in a browser environment, you may encounter a scenario
in which `window.log` is already assigned when the script loads, resulting in
Expand All @@ -106,7 +106,7 @@ in which `window.log` is already assigned when the script loads, resulting in

### Properties

### `factories`
#### `factories`

Type: `Array [ Class ]`

Expand All @@ -119,7 +119,7 @@ const { MethodFactory } = log.factories;
class MyFactory extends MethodFactory { ... }
```

### `loggers`
#### `loggers`

Type: `Array [ LogLevel ]`

Expand Down
18 changes: 9 additions & 9 deletions docs/LogLevel.md
Expand Up @@ -21,7 +21,7 @@ pairs:

## Methods

## constructor(options)
### `constructor(options)`

The constructor for this class accepts an `options` Object. The following is a
property reference for the Object:
Expand Down Expand Up @@ -74,17 +74,17 @@ disable() {
this.level = this.levels.SILENT;
}

## `disable`
### `disable`

Instructs the logger to hide output for every log level. This is equivalent
to setting the `level` property to `'silent'` or `5`.

## `enable`
### `enable`

Instructs the logger to produce output for every log level. This is equivalent
to setting the `level` property to `'trace'` or `0`.

## Properties
### Properties

#### `level(options)`

Expand Down Expand Up @@ -130,7 +130,7 @@ For example:
Would then result in a prefix of `'bar-'` prepended to the output for each log
method call.

#### `time()`
### `time()`

Type: `Function`
Default: `() => new Date().toTimeString().split(' ')[0]`
Expand All @@ -139,23 +139,23 @@ A function used to define the value used to replace instances of
`{{time}}` within the [prefix template](#template). This function should
represent the time at which the logger produced output.

## Properties
### Properties

### `factory`
#### `factory`

Type: `Class:MethodFactory`

Gets or sets the factory to use when wrapping `console` methods. When setting
this property, the value must be a class which inherits from `MethodFactory`.

### `level`
#### `level`

Type: `String|Number`

Gets or sets the level the log should operate on. When setting this property, the
value must be a `String` or `Number.`

## `levels`
#### `levels`

Type: `Object`

Expand Down
32 changes: 14 additions & 18 deletions docs/MethodFactory.md
Expand Up @@ -5,61 +5,57 @@ responsible for wrapping `console` methods to provide logging functionality.

## Methods

## `bindMethod(obj, methodName)`
### `bindMethod(obj, methodName)`

Binds a corresponding `console` method to the object specified.

Returns: `Function`

### Parameters

### `obj`
#### `obj`

Type: `Object`

### `methodName`
#### `methodName`

Type: `String`

### Parameters

## `distillLevel(level)`
### `distillLevel(level)`

Processes a valid level value and returns the numerical value.

Returns: `Number`

### Parameters

### `level`
#### `level`

Type: `Any`

The level to process.

## `levelValid(level)`
### `levelValid(level)`

Determines if a given log level corresponds to a name or value in `levels`.

Returns: `Boolean`

### Parameters

### `level`
#### `level`

Type: `Any`

The level to check.

### Parameters

## `make(methodName)`
### `make(methodName)`

Contains logic for binding the specified method and adding it to the logger.

### Parameters

### `methodName`
#### `methodName`

Type: `String`

Expand All @@ -70,29 +66,29 @@ The method to create.
The entry point for `LogLevel` instances to request binding and wrapping of log
methods.

### Properties
### Parameters

### `logLevel`
#### `logLevel`
Type: `String|Number`

Specifies the minimum level that will produce log output. The value must be a
`String` or `Number.`

## `levels`
### `levels`

Type: `Object`

Gets an object which represents the valid level name-value pairs for this log
instance. The return value will match the same property in
[`LogLevel`](LogLevel.md).

## `logger`
### `logger`

Type: `LogLevel`

Gets or sets the logger that the factory will operate on.

## `methods`
### `methods`

Type: `Array [ String ]`

Expand Down

0 comments on commit c924043

Please sign in to comment.