1.1.0 • Published 3 years ago

@daangamesdg/logger v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

A simple logger you can use to log stuff in the console

Install

yarn add / npm install @daangamesdg/logger

Usage

Basic Usage

import { Logger } from "@daangamesdg/logger";

const logger = new Logger({ name: "name", timestamp: true }); // options: { name: string; timestamp?: boolean (default = true) }
logger.info(anything, you, like);

Extending

/* CustomFormatter.ts */
import { Structure } from "@daangamesdg/logger";

Structure.extend(
	"Formatter",
	(Formatter) =>
		class CustomFormatter extends Formatter {
			// do what ever you want here

			// example
			public test(): void {
				console.log("test");
			}
		}
);

declare module "@daangamesdg/logger" {
	class Formatter {
		test(): void;
	}
}

/* index.ts */
import "absolute/path/to/CustomFormatter";
import { Formatter } from "@daangamesdg/logger";

const formatter = new Formatter().test();
logger.test(); // logs "test"

Note: the examples writting in TypeScript

Author

👤 DaanGamesDG

Lisence

Project is licensed under the © MIT License


1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago