Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

lager

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lager - npm Package Compare versions

Comparing version
0.19.0
to
0.20.0
+7
-9
PKG-INFO

@@ -1,8 +0,8 @@

Metadata-Version: 2.4
Metadata-Version: 2.3
Name: lager
Version: 0.19.0
Version: 0.20.0
Summary: EZ-PZ logging based on loguru
Keywords: beer,dgi,dgpy,logging,loguru
Author: jesse rubin
Author-email: jesse rubin <jesse@dgi.com>
License-File: LICENSE
Keywords: beer,dgi,dgpy,logging,loguru
Classifier: Development Status :: 5 - Production/Stable

@@ -13,4 +13,2 @@ Classifier: Intended Audience :: Developers

Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11

@@ -20,5 +18,5 @@ Classifier: Programming Language :: Python :: 3.12

Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.9
Requires-Dist: loguru>=0.7
Requires-Dist: typing-extensions<5,>=4.5
Requires-Dist: typing-extensions>=4.5,<5 ; python_full_version < '3.11'
Requires-Python: >=3.11, <4.0
Description-Content-Type: text/markdown

@@ -35,3 +33,3 @@

[![py_versions](https://img.shields.io/pypi/pyversions/lager.svg)](https://img.shields.io/pypi/pyversions/lager.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

@@ -38,0 +36,0 @@ **Install:** `pip install lager`

[build-system]
build-backend = "hatchling.build"
build-backend = "uv_build"
requires = ["uv-build>=0.8,<0.9"]
requires = [ "hatchling" ]
[project]
name = "lager"
version = "0.19.0"
version = "0.20.0"
description = "EZ-PZ logging based on loguru"
readme = "README.md"
keywords = [ "beer", "dgi", "dgpy", "logging", "loguru" ]
authors = [ { name = "jesse rubin", email = "jesse@dgi.com" } ]
requires-python = ">=3.9,<4.0"
keywords = ["beer", "dgi", "dgpy", "logging", "loguru"]
authors = [{ name = "jesse rubin", email = "jesse@dgi.com" }]
requires-python = ">=3.11,<4.0"

@@ -21,4 +20,2 @@ classifiers = [

"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",

@@ -29,4 +26,10 @@ "Programming Language :: Python :: 3.12",

]
dependencies = [ "loguru>=0.7", "typing-extensions>=4.5,<5" ]
dependencies = [
"loguru>=0.7",
"typing-extensions>=4.5,<5; python_version<'3.11'",
]
[dependency-groups]
dev = ["typing-extensions>=4.5,<5; python_version<'3.11'"]
[tool.hatch]

@@ -37,20 +40,15 @@ [tool.hatch.metadata]

[tool.hatch.build.targets.wheel]
packages = [ "src/lager" ]
packages = ["src/lager"]
[tool.hatch.build.targets.sdist]
include = [
"src",
"pyproject.toml",
"README.md",
"LICENSE",
]
include = ["src", "pyproject.toml", "README.md", "LICENSE"]
[tool.ruff]
extend = "../../pyproject.toml"
extend = "../../ruff.toml"
[tool.coverage.run]
source = [ 'lager' ]
source = ['lager']
branch = true
context = '${CONTEXT}'
omit = [ "**/__main__.py" ]
omit = ["**/__main__.py"]

@@ -70,4 +68,1 @@ [tool.coverage.report]

]
[tool]
dev-dependencies = [ "typing-extensions>=4.5.0,<5.0.0" ]

@@ -10,3 +10,3 @@ <a href="https://github.com/dynamic-graphics-inc/dgpy-libs">

[![py_versions](https://img.shields.io/pypi/pyversions/lager.svg)](https://img.shields.io/pypi/pyversions/lager.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

@@ -13,0 +13,0 @@ **Install:** `pip install lager`

@@ -10,2 +10,2 @@ # -*- coding: utf-8 -*-

__pkgroot__ = __file__.replace("__about__.py", "").rstrip("/\\")
__version__ = "0.19.0"
__version__ = "0.20.0"

@@ -59,5 +59,3 @@ # -*- coding: utf-8 -*-

"__version__",
#############
## HOISTED ##
#############
# __HOISTED__
"_change_activation",

@@ -64,0 +62,0 @@ "_core",

@@ -25,2 +25,3 @@ # -*- coding: utf-8 -*-

)
sys.stdout.write("\n")

@@ -27,0 +28,0 @@

@@ -6,30 +6,24 @@ # -*- coding: utf-8 -*-

from typing import Dict
LAGER_PORT = 52437
TORNADO_FMT = "".join(
[
"<level>",
"[{level.name[0]} ",
"{time:YYMMDDTHH:mm:ss} ",
"{name}:{module}:{line}]",
"</level> ",
"{message}",
]
)
TORNADO_FMT = "".join([
"<level>",
"[{level.name[0]} ",
"{time:YYMMDDTHH:mm:ss} ",
"{name}:{module}:{line}]",
"</level> ",
"{message}",
])
LOGURU_DEFAULT_FMT = "".join(
[
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green>",
" | ",
"<level>{level: <8}</level>",
" | ",
"<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan>",
" - ",
"<level>{message}</level>",
]
)
LOGURU_DEFAULT_FMT = "".join([
"<green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green>",
" | ",
"<level>{level: <8}</level>",
" | ",
"<cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan>",
" - ",
"<level>{message}</level>",
])
LOG_LEVELS: Dict[str, str] = {
LOG_LEVELS: dict[str, str] = {
"notset": "NOTSET",

@@ -36,0 +30,0 @@ "n": "NOTSET",

@@ -11,3 +11,3 @@ # -*- coding: utf-8 -*-

from time import time
from typing import Any, Callable, Dict, Optional, TypeVar, Union
from typing import TYPE_CHECKING, Any, TypeVar

@@ -19,2 +19,5 @@ from loguru import logger as logger

if TYPE_CHECKING:
from collections.abc import Callable
T = TypeVar("T")

@@ -39,3 +42,3 @@

def _serialize_record(text: str, record: Dict[str, Any]) -> str:
def _serialize_record(text: str, record: dict[str, Any]) -> str:
exception = record["exception"]

@@ -91,3 +94,3 @@

except ModuleNotFoundError:
pass
...

@@ -100,3 +103,3 @@ # lager/logger aliases

def loglevel(level: Union[str, int]) -> str:
def loglevel(level: str | int) -> str:
"""Convert log-level abrev to a valid loguru log level"""

@@ -107,4 +110,5 @@ return str(LOG_LEVELS[str(level).strip("'").strip('"').lower()])

def flog(
funk: Optional[Callable[..., T]] = None,
level: Union[str, int] = "debug",
funk: Callable[..., T] | None = None,
level: str | int = "debug",
*,
enter: bool = True,

@@ -198,3 +202,3 @@ exit: bool = True,

def handlers() -> Dict[int, Handler]:
def handlers() -> dict[int, Handler]:
"""Return all handlers"""

@@ -204,3 +208,3 @@ return logger._core.handlers # type: ignore[no-any-return]

def reset(level: Optional[Union[str, int]] = None) -> None:
def reset(level: str | int | None = None) -> None:
logger.remove()

@@ -207,0 +211,0 @@ logger.add(_sys.stderr, level=loglevel(level or "debug"))

@@ -28,2 +28,2 @@ # -*- coding: utf-8 -*-

except ImportError:
pass
...

@@ -6,4 +6,2 @@ # -*- coding: utf-8 -*-

from typing import List, Optional, Set, Tuple, Union
from lager.logging import intercept

@@ -24,3 +22,3 @@

def fastapi_intercept(
loggers: Optional[Union[List[str], Set[str], Tuple[str, ...]]] = None,
loggers: list[str] | set[str] | tuple[str, ...] | None = None,
) -> None:

@@ -27,0 +25,0 @@ _loggers2intercept = (

@@ -8,2 +8,3 @@ # -*- coding: utf-8 -*-

from collections.abc import Callable, Mapping
from logging import (

@@ -66,6 +67,4 @@ BASIC_FORMAT as BASIC_FORMAT,

from types import TracebackType
from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple, Type, Union
from typing import Any, Literal, Self, TypeAlias
from typing_extensions import Literal, Self, TypeAlias
from lager.core import LOG, loglevel

@@ -153,10 +152,10 @@

_SysExcInfoType: TypeAlias = Union[
Tuple[Type[BaseException], BaseException, Union[TracebackType, None]],
Tuple[None, None, None],
]
_ExcInfoType: TypeAlias = Union[None, bool, _SysExcInfoType, BaseException]
_ArgsType: TypeAlias = Union[Tuple[object, ...], Mapping[str, object]]
_FilterType: TypeAlias = Union[Filter, Callable[[LogRecord], bool]]
_Level: TypeAlias = Union[int, str]
_SysExcInfoType: TypeAlias = (
tuple[type[BaseException], BaseException, TracebackType | None]
| tuple[None, None, None]
)
_ExcInfoType: TypeAlias = bool | _SysExcInfoType | BaseException | None
_ArgsType: TypeAlias = tuple[object, ...] | Mapping[str, object]
_FilterType: TypeAlias = Filter | Callable[[LogRecord], bool]
_Level: TypeAlias = int | str
_FormatStyle: TypeAlias = Literal["%", "{", "$"]

@@ -186,6 +185,6 @@

def find_caller(
self, stack_info: bool = False, stacklevel: int = 1
) -> Tuple[str, int, str, Union[str, None]]:
self, *, stack_info: bool = False, stacklevel: int = 1
) -> tuple[str, int, str, str | None]:
"""snake_case alias for findCaller"""
return self.findCaller(stack_info, stacklevel)
return self.findCaller(stack_info=stack_info, stacklevel=stacklevel)

@@ -208,6 +207,6 @@ def add_handler(self, hdlr: Handler) -> None:

args: _ArgsType,
exc_info: Union[_SysExcInfoType, None],
func: Optional[str] = None,
extra: Union[Mapping[str, object], None] = None,
sinfo: Optional[str] = None,
exc_info: _SysExcInfoType | None,
func: str | None = None,
extra: Mapping[str, object] | None = None,
sinfo: str | None = None,
) -> LogRecord:

@@ -239,3 +238,3 @@ return self.makeRecord(

def set_formatter(self, fmt: Union[Formatter, None]) -> None:
def set_formatter(self, fmt: Formatter | None) -> None:
"""snake_case alias for setFormatter"""

@@ -284,7 +283,7 @@ return self.setFormatter(fmt)

def loggers_dict() -> Dict[str, logging.Logger]:
def loggers_dict() -> dict[str, logging.Logger]:
return {name: logging.getLogger(name) for name in _logger_dict()}
def intercept(loggers: List[str]) -> None:
def intercept(loggers: list[str]) -> None:
for logger in loggers:

@@ -291,0 +290,0 @@ std_logger = logging.getLogger(logger)

@@ -6,3 +6,3 @@ # -*- coding: utf-8 -*-

from typing import TYPE_CHECKING, Any, Dict, Optional, Type, Union
from typing import TYPE_CHECKING, Any

@@ -38,5 +38,5 @@ from jsonbourne.pydantic import JsonBaseModel

class RecordException(JsonBaseModel):
type: Optional[Type[BaseException]]
value: Optional[BaseException]
traceback: Optional[TracebackType]
type: type[BaseException] | None
value: BaseException | None
traceback: TracebackType | None

@@ -46,4 +46,4 @@

elapsed: timedelta
exception: Optional[RecordException]
extra: Dict[Any, Any]
exception: RecordException | None
extra: dict[Any, Any]
file: RecordFile

@@ -55,3 +55,3 @@ function: str

module: str
name: Union[str, None]
name: str | None
process: RecordProcess

@@ -58,0 +58,0 @@ thread: RecordThread

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.doctest.txt
*_tests/
*.bak/
*.bak
f.py
file.py
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.nox_win/
.nox_wsl/
.nox_lin/
.nox_win.bak/
.nox_wsl.bak/
.nox_lin.bak/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
.ipynb_checkpoints/
# pyenv
.python-version
# Environments
.env
.env.json
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# node
node_modules/
########
# MISC #
########
.DS_Store
*~
.*.sw[po]
scratch/
.pytype/
mypy_reports/
pythonenv3.8/
.idea/
monkeytype.sqlite3
.parcel-cache/
package-lock.json
.pdm.toml
__pypackages__
pdm.lock
.vscode/
dgpy-packages/
temp/
thingy.py
herm.py
yarn.lock
.pdm-python
# used for merging multiple branches at once
branches.txt
dgpy-libs
The MIT License (MIT)
Copyright (c) 2019-2025 Dynamic Graphics Inc (dgi)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# -*- coding: utf-8 -*-
"""Package metadata/info"""
from __future__ import annotations
import warnings
from lager.__about__ import __description__, __pkgroot__, __title__, __version__
warnings.warn(
"lager._meta is deprecated, use lager.__about__ instead",
DeprecationWarning,
stacklevel=2,
)
__all__ = ("__description__", "__pkgroot__", "__title__", "__version__")