Skip to content

Commit

Permalink
🎨 Improved exports
Browse files Browse the repository at this point in the history
  • Loading branch information
OfficialCRUGG committed Sep 30, 2022
1 parent 4740e72 commit d5cf638
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ yarn add @blazingworks/logger
### TypeScript

```typescript
import { Logger, ConsoleTransport } from "@blazingworks/logger";
import { Logger } from "@blazingworks/logger";
import { ConsoleTransport } from "@blazingworks/logger/transports";

const logger = new Logger({
transports: [{ module: new ConsoleTransport() }],
Expand All @@ -53,7 +54,8 @@ logger.info("Hello World");
### JavaScript

```javascript
const { Logger, ConsoleTransport } = require("@blazingworks/logger");
const { Logger } = require("@blazingworks/logger");
const { ConsoleTransport } = require("@blazingworks/logger/transports");

const logger = new Logger({
transports: [{ module: new ConsoleTransport() }],
Expand Down
4 changes: 2 additions & 2 deletions TRANSPORTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ To add a transport, you need to create a class that implements the [`TransportMo
Below, you can find an example transport based on the `ConsoleTransport` for reference:

```typescript
import { LogLevel } from "@blazingworks/logger/enums/LogLevel";
import TransportModule from "@blazingworks/logger/interfaces/TransportModule";
import { LogLevel } from "@blazingworks/logger/enums";
import { TransportModule } from "@blazingworks/logger/interfaces";

export default class MyCoolConsoleTransport implements TransportModule {
private format: string;
Expand Down
2 changes: 2 additions & 0 deletions src/enums/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { LogLevel, isLogLevel, getLogLevel, allLogLevels } from "./LogLevel";
export { LogLevel, isLogLevel, getLogLevel, allLogLevels };
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import Logger from "./Logger";
export { Logger };
4 changes: 4 additions & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import LoggerOptions from "./LoggerOptions";
import Transport from "./Transport";
import TransportModule from "./TransportModule";
export { LoggerOptions, Transport, TransportModule };
4 changes: 4 additions & 0 deletions src/transports/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import ConsoleTransport from "./ConsoleTransport";
import RawTransport from "./RawTransport";
import CustomTransport from "./CustomTransport";
export { ConsoleTransport, RawTransport, CustomTransport };

0 comments on commit d5cf638

Please sign in to comment.