Skip to content

Commit

Permalink
refactor: move to zodyac namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
bebrasmell committed Sep 15, 2024
1 parent 5ad707d commit 7400c14
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 34 deletions.
2 changes: 1 addition & 1 deletion EXTENSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ If you'd like to submit, here are the steps you can take:

| Name | Description | Package | Downloads |
| :--- | :---------- | :------ | :-------- |
| [Writer](https://github.com/bebrasmell/mono-logger-writer) | Writes logs to files | [@bebrasmell/mono-logger-writer](https://npmjs.com/package/@bebrasmell/mono-logger-writer) | ![NPM Downloads](https://img.shields.io/npm/dw/%40bebrasmell%2Fmono-logger) |
| [Writer](https://github.com/zodyac/mono-logger-writer) | Writes logs to files | [@zodyac/mono-logger-writer](https://npmjs.com/package/@zodyac/mono-logger-writer) | ![NPM Downloads](https://img.shields.io/npm/dw/%40zodyac%2Fmono-logger) |
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mono-logger
![NPM Version](https://img.shields.io/npm/v/%40bebrasmell%2Fmono-logger)
![NPM Downloads](https://img.shields.io/npm/dw/%40bebrasmell%2Fmono-logger)
![npm bundle size](https://img.shields.io/bundlephobia/min/%40bebrasmell%2Fmono-logger)
![NPM Version](https://img.shields.io/npm/v/%40zodyac%2Fmono-logger)
![NPM Downloads](https://img.shields.io/npm/dw/%40zodyac%2Fmono-logger)
![npm bundle size](https://img.shields.io/bundlephobia/min/%40zodyac%2Fmono-logger)
![Test coverage](./badges/coverage.svg)

A simple logger module with topics and side-effects capabilities.
Expand All @@ -17,20 +17,20 @@ Please see [CHANGELOG](./CHANGELOG.md) for latest changes.

## Installation
```bash
yarn add @bebrasmell/mono-logger
yarn add @zodyac/mono-logger
```

Or

```bash
npm i @bebrasmell/mono-logger
npm i @zodyac/mono-logger
```

## Topics
You can create a new child logger with a specific topic. This way you can filter logs by topic.

```typescript
import { Logger } from '@bebrasmell/mono-logger';
import { Logger } from '@zodyac/mono-logger';

const logger = new Logger();
const subLogger = logger.topic('sub-topic');
Expand All @@ -45,7 +45,7 @@ deepSubLogger.log('hello, world');
You can also access parent logger from a child logger.

```typescript
import { Logger } from '@bebrasmell/mono-logger';
import { Logger } from '@zodyac/mono-logger';

const logger = new Logger();
const subLogger = logger.topic('sub-topic');
Expand Down Expand Up @@ -83,7 +83,7 @@ You can configure the logger with:


```typescript
import { Logger } from '@bebrasmell/mono-logger';
import { Logger } from '@zodyac/mono-logger';

const ex_logger = new Logger('example', {
level: 'debug',
Expand Down Expand Up @@ -135,7 +135,7 @@ const child = root.topic("child", {

In such situations, you can use ```MonoEffect```:
```ts
import { MonoEffect } from "@bebrasmell/mono-logger";
import { MonoEffect } from "@zodyac/mono-logger";

const handleWarnings = (lvl, topics, ...messages) => {
/*
Expand Down Expand Up @@ -163,7 +163,7 @@ logger.warn("Example warning");
```PolyEffect``` simply concatenates your effects and fires them one after another.

```ts
import { MonoEffect, PolyEffect } from "@bebrasmell/mono-logger";
import { MonoEffect, PolyEffect } from "@zodyac/mono-logger";

const handleWarnings = (lvl, topics, ...messages) => {
/*
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@bebrasmell/mono-logger",
"name": "@zodyac/mono-logger",
"description": "A simple topic-based logger with side effects",
"repository": "https://github.com/bebrasmell/mono-logger.git",
"author": "Zak <137602160+bebrasmell@users.noreply.github.com>",
"version": "1.5.4",
"repository": "https://github.com/zodyac/mono-logger.git",
"author": "Zak <137602160+zodyac@users.noreply.github.com>",
"version": "2.0.0",
"private": false,
"license": "MIT",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ const METHOD: Record<LogLevel, "log" | "info" | "warn" | "error"> = {
*
* You can create one to be your new root by calling
* ```ts
* import { Logger } from "@bebrasmell/mono-logger";
* import { Logger } from "@zodyac/mono-logger";
*
* const root_logger = new Logger();
* ```
*
* Or you can use the default or existing logger to create a sub-topic
* ```ts
* import logger from "@bebrasmell/mono-logger";
* import logger from "@zodyac/mono-logger";
*
* const app_logger = logger.topic("My_app_root_topic");
* ```
Expand Down
24 changes: 7 additions & 17 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

"rootDir": "./src",
"module": "ESNext",
"rootDir": "src",
"module": "ES2022",
"target": "ES2022",
"lib": ["es2022"],
"moduleResolution": "node",
"baseUrl": "./src",
"declaration": true,
"sourceMap": true,
"outDir": "build",
"removeComments": true,
"outDir": "dist",
"allowSyntheticDefaultImports": true,
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"paths": {},
},
"include": ["src/**/*", "test.js"],
// "include": ["src/**/*"],
"exclude": [
"dist/**/*",
"node_modules/**/*",
"**/*.(spec|test).ts",
"**/__mocks__/**/*",
"dist",
"tsup.config.ts",
"node_modules",
]
}

0 comments on commit 7400c14

Please sign in to comment.