-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate package to adonisjs provider
- Loading branch information
1 parent
27680f6
commit aeca305
Showing
29 changed files
with
1,067 additions
and
1,044 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/** | ||
* @module @adonisjs/logger | ||
*/ | ||
|
||
/* | ||
* @adonisjs/logger | ||
* | ||
* (c) Harminder Virk <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare module '@ioc:Adonis/Core/Logger' { | ||
import { | ||
Level, | ||
TimeFn, | ||
redactOptions, | ||
PrettyOptions, | ||
SerializerFn, | ||
LevelMapping, | ||
DestinationStream, | ||
} from 'pino' | ||
|
||
/** | ||
* Config shape | ||
*/ | ||
export type LoggerConfigContract = { | ||
name: string, | ||
level: Level | 'silent' | string, | ||
enabled: boolean, | ||
messageKey?: string, | ||
safe?: boolean, | ||
crlf?: boolean, | ||
useLevelLabels?: boolean, | ||
levelKey?: string, | ||
timestamp?: TimeFn | boolean, | ||
customLevels?: { | ||
[key: string]: number, | ||
}, | ||
useOnlyCustomLevels?: boolean, | ||
redact?: string[] | redactOptions, | ||
prettyPrint?: boolean | PrettyOptions, | ||
base?: { [key: string]: any } | null, | ||
serializers?: { [key: string]: SerializerFn }, | ||
stream?: DestinationStream, | ||
} | ||
|
||
/** | ||
* Logger interface that main and fake logger implements | ||
*/ | ||
export interface LoggerContract { | ||
level: string, | ||
levelNumber: number, | ||
levels: LevelMapping, | ||
pinoVersion: string, | ||
LOG_VERSION: number, | ||
|
||
log (level: string, message: string, ...values: any[]): void | ||
log (level: string, mergingObject: any, message: string, ...values: any[]): void | ||
|
||
trace (message: string, ...values: any[]): void | ||
trace (mergingObject: any, message: string, ...values: any[]): void | ||
|
||
debug (message: string, ...values: any[]): void | ||
debug (mergingObject: any, message: string, ...values: any[]): void | ||
|
||
info (message: string, ...values: any[]): void | ||
info (mergingObject: any, message: string, ...values: any[]): void | ||
|
||
warn (message: string, ...values: any[]): void | ||
warn (mergingObject: any, message: string, ...values: any[]): void | ||
|
||
error (message: string, ...values: any[]): void | ||
error (mergingObject: any, message: string, ...values: any[]): void | ||
|
||
fatal (message: string, ...values: any[]): void | ||
fatal (mergingObject: any, message: string, ...values: any[]): void | ||
|
||
isLevelEnabled (level: string): boolean, | ||
bindings (): { [key: string]: any }, | ||
child (bindings: { | ||
level?: Level | string, | ||
serializers: { [key: string]: SerializerFn }, | ||
[key: string]: any, | ||
}): LoggerContract, | ||
} | ||
|
||
const Logger: LoggerContract | ||
export default Logger | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
**[@poppinss/logger](README.md)** | ||
**[@adonisjs/logger](README.md)** | ||
|
||
[Globals](README.md) | ||
|
||
## Index | ||
|
||
### External modules | ||
|
||
* ["FakeLogger"](modules/_fakelogger_.md) | ||
* ["Logger"](modules/_logger_.md) | ||
* ["contracts"](modules/_contracts_.md) | ||
* ["getPino"](modules/_getpino_.md) | ||
* ["adonis-typings/logger"](modules/_adonis_typings_logger_.md) | ||
* ["providers/LoggerProvider"](modules/_providers_loggerprovider_.md) | ||
* ["src/FakeLogger"](modules/_src_fakelogger_.md) | ||
* ["src/Logger"](modules/_src_logger_.md) | ||
* ["src/getPino"](modules/_src_getpino_.md) | ||
* ["standalone"](modules/_standalone_.md) |
Oops, something went wrong.