Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/justaos_utils/packages/logger-utils/deps.ts

Common utility functions used across projects
Go to Latest
import * as justaosUtils from "https://deno.land/x/justaos_utils@v1.9.0/packages/logger-utils/deps.ts";

Namespaces

Logging library with the support for terminal and file outputs. Also provides interfaces for building custom loggers.

Classes

This is the default logger. It will output color coded log messages to the console via console.log().

This handler will output to a file using an optional mode (default is a, e.g. append). The file will grow indefinitely. It uses a buffer for writing to file. Logs can be manually flushed with fileHandler.flush(). Log messages with a log level greater than error are immediately flushed. Logs are also flushed on process completion.

An object that encapsulates provided message and arguments as well some metadata that can be later used when formatting a message.

This handler extends the functionality of the FileHandler by "rotating" the log file when it reaches a certain size. maxBytes specifies the maximum size in bytes that the log file can grow to before rolling over to a new one. If the size of the new log message plus the current log file size exceeds maxBytes then a roll-over is triggered. When a roll-over occurs, before the log message is written, the log file is renamed and appended with .1. If a .1 version already existed, it would have been renamed .2 first and so on. The maximum number of log files to keep is specified by maxBackupCount. After the renames are complete the log message is written to the original, now blank, file.

Variables

Handlers are responsible for actual output of log messages. When a handler is called by a logger, it firstly checks that LogRecord's level is not lower than level of the handler. If level check passes, handlers formats log record into string and outputs it to target.

Permitted log level names

Use this to retrieve the numeric log level by it's associated name. Defaults to INFO.

Functions

Get a logger instance. If not specified name, get the default logger.

Log with critical level, using default logger.

Log with debug level, using default logger.

Log with error level, using default logger.

Returns the numeric log level associated with the passed, stringy log level name.

Returns the stringy log level name provided the numeric log level.

Get a logger instance. If not specified name, get the default logger.

Log with info level, using default logger.

Setup logger config.

Log with warning level, using default logger.

f
log.warning
deprecated

Type Aliases

Union of valid log level names

Union of valid log levels