Skip to content

Commit

Permalink
Merge tag '0.2.1'
Browse files Browse the repository at this point in the history
LogTape 0.2.1
  • Loading branch information
dahlia committed Apr 19, 2024
2 parents a400845 + 331a189 commit 25e5714
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Version 0.3.0
To be released.


Version 0.2.1
-------------

Released on April 20, 2024.

- Removed `FileSinkDriver` interface.
- Added `RotatingFileSinkOptions` interface.


Version 0.2.0
-------------

Expand Down
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,36 @@ LogTape
> LogTape is still in the early stage of development. The API is not stable
> yet. Please be careful when using it in production.
LogTape is a simple logging library with zero dependencies for
Deno/Node.js/Bun/browsers. It is designed to be used for both applications
and libraries.
LogTape is a logging library for JavaScript and TypeScript. It provides a
simple and flexible logging system that is easy to use and easy to extend.
The highlights of LogTape are:

- *Zero dependencies*: LogTape has zero dependencies. You can use LogTape
without worrying about the dependencies of LogTape.

- *Library support*: LogTape is designed to be used in libraries as well
as applications. You can use LogTape in libraries to provide logging
capabilities to users of the libraries.

- *Runtime diversity*: LogTape supports Deno, Node.js, Bun, edge functions,
and browsers. You can use LogTape in various environments without
changing the code.

- *Structured logging*: LogTape supports structured logging. You can log
messages with structured data. LogTape provides a simple and flexible
way to log structured data.

- *Hierarchical categories*: LogTape uses a hierarchical category system
to manage loggers. You can control the verbosity of log messages by
setting the log level of loggers at different levels of the category
hierarchy.

- *Template literals*: LogTape supports template literals for log messages.
You can use template literals to log messages with placeholders and
values.

- *Dead simple sinks*: LogTape provides a simple and flexible way to add
sinks. You can easily add your own sinks to LogTape.

Currently, LogTape provides only few sinks, but [you can easily add your own
sinks.](#sinks)
Expand All @@ -23,7 +50,7 @@ sinks.](#sinks)
![](./screenshots/terminal-console.png)

[JSR]: https://jsr.io/@logtape/logtape
[JSR badge]: https://jsr.io/badges/@logtape/logtape?v=0.2.0
[JSR badge]: https://jsr.io/badges/@logtape/logtape?v=0.2.1
[npm]: https://www.npmjs.com/package/@logtape/logtape
[npm badge]: https://img.shields.io/npm/v/@logtape/logtape?logo=npm
[GitHub Actions]: https://github.com/dahlia/logtape/actions/workflows/main.yaml
Expand Down Expand Up @@ -100,7 +127,8 @@ logger.error `This is an error message with ${value}.`;
logger.fatal `This is a fatal message with ${value}.`;
~~~~

You can also log messages with a function call:
You can also log messages with a function call. In this case, log messages
are structured data:

~~~~ typescript
logger.debug("This is a debug message with {value}.", { value });
Expand Down
2 changes: 1 addition & 1 deletion logtape/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export { getLogger, type Logger } from "./logger.ts";
export type { LogLevel, LogRecord } from "./record.ts";
export {
type ConsoleSinkOptions,
type FileSinkDriver,
type FileSinkOptions,
getConsoleSink,
getStreamSink,
type RotatingFileSinkOptions,
type Sink,
type StreamSinkOptions,
} from "./sink.ts";
Expand Down

0 comments on commit 25e5714

Please sign in to comment.