当前位置: 首页>>代码示例>>Python>>正文


Python log.get_logger函数代码示例

本文整理汇总了Python中tendril.utils.log.get_logger函数的典型用法代码示例。如果您正苦于以下问题:Python get_logger函数的具体用法?Python get_logger怎么用?Python get_logger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_logger函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_log_default

def test_log_default():
    logger = log.get_logger("Default_Logger", log.DEFAULT)
    assert logger.name == "Default_Logger"
    assert logger.level == log.DEFAULT

    logger = log.get_logger("SP_Default_Logger", log.DEFAULT)
    assert logger.name == "SP_Default_Logger"
    assert logger.level == log.DEFAULT

    logger = log.get_logger("YA_Default_Logger")
    assert logger.name == "YA_Default_Logger"
    assert logger.level == log.DEFAULT
开发者ID:chintal,项目名称:tendril,代码行数:12,代码来源:test_utils_log.py

示例2: test_log_other

def test_log_other():
    logger = log.get_logger("Critical_Logger", log.CRITICAL)
    assert logger.name == "Critical_Logger"
    assert logger.level == logging.CRITICAL

    logger = log.get_logger("Error_Logger", log.ERROR)
    assert logger.name == "Error_Logger"
    assert logger.level == logging.ERROR

    logger = log.get_logger("Warning_Logger", log.WARNING)
    assert logger.name == "Warning_Logger"
    assert logger.level == logging.WARNING

    logger = log.get_logger("Info_Logger", log.INFO)
    assert logger.name == "Info_Logger"
    assert logger.level == logging.INFO

    logger = log.get_logger("Debug_Logger", log.DEBUG)
    assert logger.name == "Debug_Logger"
    assert logger.level == logging.DEBUG
开发者ID:chintal,项目名称:tendril,代码行数:20,代码来源:test_utils_log.py

示例3: render_test_report

from tendril.testing import analysis
from tendril.utils.db import with_db
from tendril.entityhub import serialnos
from tendril.entityhub import projects
from tendril.gedaif.conffile import ConfigsFile
from tendril.utils import vcs
from tendril.entityhub.db.model import SerialNumber
from tendril.entityhub.db import controller as sno_controller

from render import render_pdf
import docstore

from tendril.utils.config import INSTANCE_ROOT
from tendril.utils import log

logger = log.get_logger(__name__, log.DEFAULT)
default_target = os.path.join(INSTANCE_ROOT, 'scratch', 'testing')


@with_db
def render_test_report(serialno=None, outfolder=None, session=None):
    """
    Renders the latest test results marked against the specified ``serialno``.

    Since this function is defined against the database, all arguments should
    be keyword arguments.

    :param serialno: The serial number of the device.
    :type serialno: :class:`str` or :class:`tendril.entityhub.db.SerialNumber`
    :param outfolder: The folder in which the output file should be created.
    :type outfolder: str
开发者ID:chintal,项目名称:tendril,代码行数:31,代码来源:testing.py

示例4: QtyGuidelines

#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
"""
This file is part of tendril
See the COPYING, README, and INSTALL files for more information
"""

import os

from tendril.entityhub.guidelines import QtyGuidelines
from tendril.utils.config import INSTANCE_ROOT

from tendril.utils import log
logger = log.get_logger(__name__, log.INFO)


electronics_qty_file = os.path.join(INSTANCE_ROOT,
                                    'inventory',
                                    'guidelines',
                                    'electronics-qty.yaml'
                                    )
logger.info("Loading Electronics Inventory Qty Guidelines from file : " +
            os.linesep + electronics_qty_file)
electronics_qty = QtyGuidelines(electronics_qty_file)
开发者ID:chintal,项目名称:tendril,代码行数:30,代码来源:__init__.py

示例5: _get_parser

.. rubric:: Script Usage

.. argparse::
    :module: tendril.scripts.getdox
    :func: _get_parser
    :prog: tendril-getdox
    :nodefault:

"""


import argparse

from tendril.dox import docstore
from tendril.utils import log
logger = log.get_logger("getdox", log.DEFAULT)


def _get_parser():
    """
    Constructs the CLI argument parser for the tendril-getdox script.
    """
    parser = argparse.ArgumentParser(
        description='Copy published documents into the workspace.',
        prog='tendril-getdox'
    )
    parser.add_argument(
        'serialno', metavar='SNO', type=str, nargs='?',
        help='Document serial number'
    )
    parser.add_argument(
开发者ID:chintal,项目名称:tendril,代码行数:31,代码来源:getdox.py

示例6: _get_parser

import os
import argparse

from tendril.entityhub import projects
from tendril.sourcing import csil

from tendril.gedaif.conffile import NoGedaProjectError
from tendril.gedaif import conffile

from tendril.utils.config import PROJECTS_ROOT
from tendril.utils.fsutils import in_directory

from .helpers import add_project_selector_options

from tendril.utils import log
logger = log.get_logger("genpcbpricing", log.DEFAULT)


def _get_parser():
    """
    Constructs the CLI argument parser for the tendril-genpcbpricing script.
    """
    parser = argparse.ArgumentParser(
        description='(Re-)Generate CSIL PCB Pricing Information.',
        prog='tendril-genpcbpricing'
    )
    parser.add_argument(
        '--force', '-f', action='store_true', default=False,
        help='Regenerate pricing even if it seems to be up-to-date'
    )
    parser.add_argument(
开发者ID:chintal,项目名称:tendril,代码行数:31,代码来源:genpcbpricing.py

示例7: _get_parser

    :module: tendril.scripts.writecalib
    :func: _get_parser
    :prog: tendril-writecalib
    :nodefault:

"""


import argparse

from tendril.entityhub import macs
from tendril.entityhub import serialnos
from tendril.testing import testrunner
from tendril.utils import log

logger = log.get_logger("writecalib", log.DEFAULT)


def _get_parser():
    """
    Constructs the CLI argument parser for the tendril-writecalib script.
    """
    parser = argparse.ArgumentParser(description="Write calibration parameters to device.", prog="tendril-writecalib")
    parser.add_argument("serialno", metavar="SNO", type=str, nargs="?", help="Device serial number")
    parser.add_argument(
        "--detect",
        "-d",
        metavar=("MACTYPE"),
        type=str,
        nargs=1,
        help="Autodetect serial number using the specified MACTYPE. " "No effect if serial number specified.",
开发者ID:chintal,项目名称:tendril,代码行数:31,代码来源:writecalib.py

示例8: gen_pcb_am

from fs.utils import copyfile

import docstore
import render
from tendril.boms.outputbase import DeltaOutputBom
from tendril.entityhub import projects
from tendril.entityhub import serialnos
from tendril.entityhub.modules import get_module_instance
from tendril.entityhub.modules import get_module_prototype
from tendril.gedaif.conffile import ConfigsFile
from tendril.utils import log
from tendril.utils.fsutils import get_tempname
from tendril.utils.fsutils import temp_fs
from tendril.utils.files.pdf import merge_pdf
logger = log.get_logger(__name__, log.DEBUG)


def gen_pcb_am(configname, outfolder, sno=None, productionorderno=None,
               indentsno=None, scaffold=False, verbose=True, session=None):
    """
    Generates a PCB Assembly Manifest for a 'card', a card being defined as a
    gEDA project, with a specified ``configname``.

    In the present implementation, the project could provide either a PCB or a
    Cable.

        - In case the project provides the card, the schematic for the cable
          is included along with the assembly manifest.
        - In case the project provides a PCB, the schematic is not included
          with the assembly manifest.
开发者ID:chintal,项目名称:tendril,代码行数:30,代码来源:production.py

示例9: BomLine

import shutil

from tendril.conventions.motifs import create_motif_object
from tendril.conventions.electronics import ident_transform
from tendril.boms.validate import ValidationContext
from tendril.boms.validate import ErrorCollector
from tendril.boms.validate import BomMotifPolicy
from tendril.boms.validate import BomMotifUnrecognizedError

import projfile

from tendril.utils.config import INSTANCE_CACHE
from tendril.utils.config import PROJECTS_ROOT
from tendril.utils import fsutils
from tendril.utils import log
logger = log.get_logger(__name__, level=log.WARNING)


FNULL = open(os.devnull, 'w')


class BomLine(object):

    def __init__(self, line, columns):
        self.data = {}
        elems = line.split('\t')
        for i in range(len(columns)):
            self.data[columns[i]] = elems[i]

    def __repr__(self):
        return self.data.__repr__()
开发者ID:chintal,项目名称:tendril,代码行数:31,代码来源:bomparser.py


注:本文中的tendril.utils.log.get_logger函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。