justlog

A simple library for logging with Python3

Basics

For a quick example, refer to the test.py on the github repository

With justlog, everything is handled within a single class: Logger

Spawn an instance of this class to start logging quickly.

from justlog import justlog, settings
logger = justlog.Logger(settings.Settings())

Instances must be initialized with a Settings instance that can be customized before or after instantiation.

Syntax

Logger

Settings

Builtin Variables

Quickstart

from justlog import justlog, settings
from justlog.classes import Severity, Output, Format

logger_stdout = justlog.Logger(settings.Settings())
logger_stdout.settings.colorized_logs = True
logger_stdout.settings.log_output = [Output.STDOUT]
logger_stdout.settings.update_field("application", "sample")
logger_stdout.settings.update_field("timestamp", "$TIMESTAMP")
logger_stdout.settings.update_field("level", "$CURRENT_LOG_LEVEL")
logger_stdout.settings.string_format = "[ $timestamp ] :: Level: $CURRENT_LOG_LEVEL, application: $application :: $message"

logger_stdout.info("Information")
logger_stdout.error("Error")
logger_stdout.warning("Warning")
logger_stdout.debug("Debug")