mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-24 03:36:55 -04:00
fix rich logging issues
This commit is contained in:
parent
0dffbf1bb4
commit
e99260feb2
5 changed files with 39 additions and 50 deletions
|
@ -30,7 +30,7 @@ from core.models import Snapshot, ArchiveResult, Tag
|
|||
from core.mixins import SearchResultsAdminMixin
|
||||
from api.models import APIToken
|
||||
from abid_utils.admin import ABIDModelAdmin
|
||||
from queues.tasks import bg_archive_links, bg_add
|
||||
from queues.tasks import bg_archive_links, bg_archive_link, bg_add
|
||||
|
||||
from index.html import snapshot_icons
|
||||
from logging_util import printable_filesize
|
||||
|
|
|
@ -19,6 +19,8 @@ from django.conf import settings
|
|||
|
||||
from abid_utils.models import ABIDModel, ABIDField, AutoDateTimeField
|
||||
|
||||
from queues.tasks import bg_archive_snapshot
|
||||
|
||||
from ..system import get_dir_size
|
||||
from ..util import parse_date, base_url
|
||||
from ..index.schema import Link
|
||||
|
@ -160,6 +162,9 @@ class Snapshot(ABIDModel):
|
|||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def archive(self, overwrite=False, methods=None):
|
||||
result = bg_archive_snapshot(self, overwrite=overwrite, methods=methods)
|
||||
return result
|
||||
|
||||
def __repr__(self) -> str:
|
||||
title = (self.title_stripped or '-')[:64]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
__package__ = 'archivebox.core'
|
||||
import re
|
||||
import tempfile
|
||||
import logging
|
||||
|
@ -7,6 +8,8 @@ import django.template
|
|||
|
||||
import archivebox
|
||||
|
||||
from ..misc.logging import IS_TTY
|
||||
|
||||
|
||||
IGNORABLE_URL_PATTERNS = [
|
||||
re.compile(r"/.*/?apple-touch-icon.*\.png"),
|
||||
|
@ -101,7 +104,7 @@ SETTINGS_LOGGING = {
|
|||
"formatter": "rich",
|
||||
"level": "DEBUG",
|
||||
"markup": False,
|
||||
"rich_tracebacks": True,
|
||||
"rich_tracebacks": IS_TTY,
|
||||
"filters": ["noisyrequestsfilter"],
|
||||
"tracebacks_suppress": [
|
||||
django,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue