2.0.0 • Published 1 year ago

logcm v2.0.0

Weekly downloads
-
License
GPL-3.0-only
Repository
github
Last release
1 year ago

logcm

A modular logger for javascript/typescript projects. This logger can be used to log messages to the console, file, database, etc. You can easily add new providers by extending the Provider class. The logger can be configured to log messages in a specific format. The log integrity can be ensured by using a secret key to add a hmac signature to the log messages.

Usage/Examples

The logger can be used in the following way:

import { Logger } from "logcm";
import {
  ConsoleProvider,
  FileProvider,
  DiscordProvider,
} from "logcm/providers";

const logger = Logger.getLogger(
  "[TYPE] HH:MI:SS:MS DD/MM/YYYY TZ MSG",
  [
    new DiscordProvider({
      webhookUrl: "discord webhook url",
    }),
    new FileProvider(),
    new ConsoleProvider(),
  ],
  process.env.SECRET,
);

logger.info("This is an info message");

logger.warn("This is a warning message");

logger.debug("This is a debug message");

logger.critical("This is a critical message");

logger.error("This is an error message");

Installation

Install my-project with npm, pnpm or yarn

  npm install logcm
  yarn add logcm
  pnpm add logcm

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

Authors

Roadmap

  • Add more providers.
1.1.1

1 year ago

1.1.0

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.2

1 year ago

2.0.0

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.1

1 year ago