Log messages in the terminal and browser
This is a small, but useful, library for logging messages in the terminal and browser consoles.
Colorful messages can be logged in the terminal and browser consoles that support ANSI colors.
👌 Easy to use
🔌 Pluggable reporters
💻 Consistent terminal experience
🔖 Tag support
🌐 Browser support
This package is ESM only.
In Node.js with yarn:
yarn add @flex-development/log
See Git - Protocols | Yarn for details regarding installing from Git.
In Deno with esm.sh
:
import { createLogger } from 'https://esm.sh/@flex-development/log'
In browsers with esm.sh
:
<script type="module">
import { logger } from 'https://esm.sh/@flex-development/log'
</script>
TODO: use
This package exports the following identifiers:
The default export is logger
.
👉 Note: See the source code for the most up-to-date documentation.
(Logger
) The default, pre-configured logger.
Logs are written using the FancyReporter
.
Create a new logger.
options
(LogLevelOption
|LoggerOptions
, optional) — Log level or configuration options
(Logger
) Logger object
(Readonly<Record<LogType, LogLevel>>
) Map where each key is a log type
and each value is a log level.
TODO: Reporter
TODO: BaseReporter
TODO: FancyReporter
This package is fully typed with TypeScript.
TODO: Logger
TODO: InputLogObject
TODO: InspectOptions
TODO: LogFormatOptions
TODO: LogFunction
TODO: LogFunctions
TODO: LogLevel
TODO: LogLevelMap
TODO: LogLevelOption
TODO: LogLevelType
TODO: LogObject
TODO: LogType
TODO: LogTypeFunctions
TODO: LogTypeMap
TODO: LoggerOptions
TODO: ReportersOption
TODO: WriteStream
See CONTRIBUTING.md
.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.