DefinitelyTyped/types/hexo-log/index.d.ts
Rebecca Turner 12453a8fe1 [chai] Provide type definitions for chai.use (#37451)
* chai: Add types for chai.use and chai.util

Helps developers write Chai plugins; requested in #29922.

Closes #29922.

* Updated dependencies on Chai

- Minimum TS version: 3.0
    - Version bumps to TS 3.0 for the following type definitions which
      depend on chai directly or indirectly:
            bardjs, chai, chai-almost, chai-arrays, chai-as-promised,
            chai-datetime, chai-dom, chai-enzyme, chai-fs, chai-fuzzy,
            chai-jest-snapshot, chai-jquery, chai-json-schema,
            chai-moment, chai-oequal, chai-roughly, chai-spies,
            chai-string, chai-subset, chai-things, chai-uuid,
            chai-webdriverio, chai-xml, d3kit, deep-equal-in-any-order,
            dirty-chai, ember-mocha, hexo, hexo-log, hexo-util,
            jsx-chai, karma-chai, karma-chai-sinon, redux-test-utils,
            and sinon-chai
- Use Chai.ChaiPlugin instead of (chai: any, utils: any) => void

* Factor out pathval types

- Forgot that the pathval types aren't merged yet

* Factor out pathval types

- Forgot that the pathval types aren't merged yet

* Make 'chainingBehavior' non-mandatory
2019-08-08 08:58:47 -07:00

160 lines
4.6 KiB
TypeScript

// Type definitions for hexo-log 0.2
// Project: http://hexo.io/
// Definitions by: segayuu <https://github.com/segayuu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
import bunyan = require('hexo-bunyan');
import streams = require('stream');
declare class HexoLogger extends bunyan {
/**
* Returns a boolean: is the `debug` level enabled?
*
* This is equivalent to `log.isDebugEnabled()` or `log.isEnabledFor(DEBUG)` in log4j.
*/
d(): boolean;
/**
* Special case to log an `Error` instance to the record.
* This adds an `err` field with exception details
* (including the stack) and sets `msg` to the exception
* message or you can specify the `msg`.
*/
d(error: Error, ...params: any[]): void;
/**
* The first field can optionally be a "fields" object, which
* is merged into the log record.
*
* To pass in an Error *and* other fields, use the `err`
* field name for the Error instance.
*/
d(obj: object, ...params: any[]): void;
/**
* Uses `util.format` for msg formatting.
*/
d(format: any, ...params: any[]): void;
/**
* Returns a boolean: is the `info` level enabled?
*
* This is equivalent to `log.isInfoEnabled()` or `log.isEnabledFor(INFO)` in log4j.
*/
i(): boolean;
/**
* Special case to log an `Error` instance to the record.
* This adds an `err` field with exception details
* (including the stack) and sets `msg` to the exception
* message or you can specify the `msg`.
*/
i(error: Error, ...params: any[]): void;
/**
* The first field can optionally be a "fields" object, which
* is merged into the log record.
*
* To pass in an Error *and* other fields, use the `err`
* field name for the Error instance.
*/
i(obj: object, ...params: any[]): void;
/**
* Uses `util.format` for msg formatting.
*/
i(format: any, ...params: any[]): void;
/**
* Returns a boolean: is the `warn` level enabled?
*
* This is equivalent to `log.isWarnEnabled()` or `log.isEnabledFor(WARN)` in log4j.
*/
w(): boolean;
/**
* Special case to log an `Error` instance to the record.
* This adds an `err` field with exception details
* (including the stack) and sets `msg` to the exception
* message or you can specify the `msg`.
*/
w(error: Error, ...params: any[]): void;
/**
* The first field can optionally be a "fields" object, which
* is merged into the log record.
*
* To pass in an Error *and* other fields, use the `err`
* field name for the Error instance.
*/
w(obj: object, ...params: any[]): void;
/**
* Uses `util.format` for msg formatting.
*/
w(format: any, ...params: any[]): void;
/**
* Returns a boolean: is the `error` level enabled?
*
* This is equivalent to `log.isErrorEnabled()` or `log.isEnabledFor(ERROR)` in log4j.
*/
e(): boolean;
/**
* Special case to log an `Error` instance to the record.
* This adds an `err` field with exception details
* (including the stack) and sets `msg` to the exception
* message or you can specify the `msg`.
*/
e(error: Error, ...params: any[]): void;
/**
* The first field can optionally be a "fields" object, which
* is merged into the log record.
*
* To pass in an Error *and* other fields, use the `err`
* field name for the Error instance.
*/
e(obj: object, ...params: any[]): void;
/**
* Uses `util.format` for msg formatting.
*/
e(format: any, ...params: any[]): void;
/**
* Returns a boolean: is the `info` level enabled?
*
* This is equivalent to `log.isInfoEnabled()` or `log.isEnabledFor(INFO)` in log4j.
*/
log(): boolean;
/**
* Special case to log an `Error` instance to the record.
* This adds an `err` field with exception details
* (including the stack) and sets `msg` to the exception
* message or you can specify the `msg`.
*/
log(error: Error, ...params: any[]): void;
/**
* The first field can optionally be a "fields" object, which
* is merged into the log record.
*
* To pass in an Error *and* other fields, use the `err`
* field name for the Error instance.
*/
log(obj: object, ...params: any[]): void;
/**
* Uses `util.format` for msg formatting.
*/
log(format: any, ...params: any[]): void;
}
declare function createLogger(options?: { name?: string; silent?: boolean; debug?: boolean; }): HexoLogger;
export = createLogger;