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


Python Logger.getLogger方法代码示例

本文整理汇总了Python中Utils.Logger.getLogger方法的典型用法代码示例。如果您正苦于以下问题:Python Logger.getLogger方法的具体用法?Python Logger.getLogger怎么用?Python Logger.getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils.Logger的用法示例。


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

示例1: TemplateAnnotation

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
#-------------------------------------
import os
from Utils import GeomUtils
from Utils.Template import TemplateDict
from Utils import Logger

from SketchFramework import Point
from SketchFramework import Stroke
from SketchFramework import SketchGUI

from SketchFramework.Annotation import Annotation
from SketchFramework.Board import BoardObserver, BoardSingleton


logger = Logger.getLogger('TemplateObserver', Logger.DEBUG )

#-------------------------------------

class TemplateAnnotation(Annotation):
    "Annotation for strokes matching templates. Fields: name - the template's tag/name, template - the list of points making up the template"
    def __init__(self, tag, template):
        Annotation.__init__(self)
        self.template = template
        self.name = tag
        
#-------------------------------------

class TemplateMarker( BoardObserver ):
    "Compares all strokes with templates and annotates strokes with any template within some threshold."
    def __init__(self):
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:32,代码来源:TemplateObserver.py

示例2: TkSketchGUI

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
#from SketchFramework.strokeout import imageBufferToStrokes, imageToStrokes
#from SketchFramework.NetworkReceiver import ServerThread
from Utils.StrokeStorage import StrokeStorage
from Utils.GeomUtils import getStrokesIntersection
from Utils import Logger

from Observers.ObserverBase import Animator

# Constants
WIDTH = 1000
HEIGHT = 800
MID_W = WIDTH/2
MID_H = HEIGHT/2

   
logger = Logger.getLogger("TkSketchGUI", Logger.DEBUG)

class TkSketchGUI(_SketchGUI):

    Singleton = None
    def __init__(self):
       "Set up members for this GUI"
       global HEIGHT, WIDTH
       self.sketchFrame = None

       TkSketchGUI.Singleton = self
       self.run()
    def run(self):
       root = Tk()
       root.title("Sketchy/Scratch")
       self.sketchFrame = TkSketchFrame(master = root)
开发者ID:loserpenguin15,项目名称:UCSBsketch,代码行数:33,代码来源:TkSketchGUI.py

示例3: TestAnnotation

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
import time
import math
import sys
import pdb

from Utils import Logger
from Utils import GeomUtils
from SketchFramework.Point import Point
from SketchFramework.Stroke import Stroke
from SketchFramework.Board import BoardObserver
from SketchFramework.Annotation import Annotation, AnimateAnnotation
from Observers import ObserverBase


logger = Logger.getLogger('TestObserver', Logger.DEBUG)

#-------------------------------------

class TestAnnotation(AnimateAnnotation):
    def __init__(self):
        Annotation.__init__(self)
        self.dt = 0
        self.pattern = [1,1,1,1,1,0,0,0,0,0,2,0,0,0,0,0]
        self.idx = 0

    def step(self,dt):
        "Test animator, tracks the time since this was last called"
        self.idx = (self.idx + 1) % len(self.pattern)
        self.dt += dt
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:31,代码来源:TestAnimObserver.py

示例4: int

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from sketchvision.ImageStrokeConverter import imageBufferToStrokes, GETNORMWIDTH
from Utils.StrokeStorage import StrokeStorage
from Utils import Logger

from Observers.ObserverBase import Animator

# Constants
WIDTH = 1024
HEIGHT = int(4.8 * WIDTH / 8)

MID_W = WIDTH/2
MID_H = HEIGHT/2

   
logger = Logger.getLogger("NetSketchGUI", Logger.DEBUG)


class DrawAction(object):
    "Base class for a draw action"
    def __init__(self, action_type):
        self.action_type = action_type
    def xml(self):
        raise NotImplemented

class DrawCircle(DrawAction):
    "An object that defines parameters for drawing a circle"
    def __init__(self, x, y, radius, color, fill, width):
        DrawAction.__init__(self, "Circle")
        self.x = x
        self.y = y
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:32,代码来源:VisionServer.py

示例5: MyCollector

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
>>> m = MyCollector([Annotation],Annotation2)


"""

#-------------------------------------

import math
from Utils import Logger
from Utils import GeomUtils
from SketchFramework.Point import Point
from SketchFramework.Stroke import Stroke
from SketchFramework.Board import BoardObserver, BoardSingleton
from SketchFramework.Annotation import Annotation, AnnotatableObject

logger = Logger.getLogger('ObserverBase', Logger.WARN )

#-------------------------------------

class Visualizer( BoardObserver ):
    "Watches for annotations, draws them"
    def __init__(self, anno_type):
        BoardSingleton().AddBoardObserver( self )
        BoardSingleton().RegisterForAnnotation( anno_type, self )
        self.annotation_list = []

    def onAnnotationAdded( self, strokes, annotation ):
        logger.debug("anno added   %s", annotation )
        self.annotation_list.append(annotation)
  
 
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:31,代码来源:ObserverBase.py

示例6: Point

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
# import sys
from SketchFramework.Annotation import AnnotatableObject
from Utils import Logger

logger = Logger.getLogger("Point", Logger.WARN)


class Point(AnnotatableObject):
    "Point defined by X, Y, T.  X,Y Cartesian Coords, T as Time"

    def __init__(self, xLoc, yLoc, drawTime=0):
        AnnotatableObject.__init__(self)
        # self.X = int(xLoc)
        # self.Y = int(yLoc)
        # self.T = int(drawTime)
        self.X = float(xLoc)
        self.Y = float(yLoc)
        self.T = float(drawTime)

    def distance(self, point2):
        "Returns the distance from this point to the point in argument 1"
        logger.error("Point.distance deprecated, use GeomUtils.pointDist")
        return 0.0

    def copy(self):
        return Point(self.X, self.Y, self.T)

    def __str__(self):
        return "(" + ("%.1f" % self.X) + "," + ("%.1f" % self.Y) + ")"
        # return "(" + str(self.X) + "," + str(self.Y) + ")"
        # return "(" + str(self.X) + "," + str(self.Y) + "," + str(self.T) + ")"
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:33,代码来源:Point.py

示例7: MultAnnotation

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from Utils import GeomUtils

from Observers import CircleObserver
from Observers import LineObserver
from Observers import ObserverBase

from SketchFramework.Point import Point
from SketchFramework.Stroke import Stroke
from SketchFramework.Board import BoardObserver
from SketchFramework.Annotation import Annotation, AnnotatableObject

from xml.etree import ElementTree as ET

from Bin import DirectedLine

logger = Logger.getLogger('TextObserver', Logger.WARN )

#-------------------------------------

class MultAnnotation(Annotation):
    def __init__(self, scale):
        "Create a Text annotation. text is the string, and scale is an appropriate size"
        Annotation.__init__(self)
        self.scale = scale # an approximate "size" for the text
    def xml(self):
        root = Annotation.xml(self)
        root.attrib['scale'] = str(self.scale)
        return root

#-------------------------------------
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:32,代码来源:MultObserver.py

示例8: Stroke

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
import sys
import traceback
from Utils import Logger
from SketchFramework.Point import Point
from SketchFramework.Annotation import Annotation, AnnotatableObject
from xml.etree import ElementTree as ET

logger = Logger.getLogger('Stroke', Logger.WARN )


#FIXME: this module is in dire need of some documentation

class Stroke(AnnotatableObject):
    "Stroke defined as a List of Points: Points"

    # counter shared with all strokes, incremented on each new stroke
    Number = 0
    DefaultStrokeColor = "#000000"

    def __repr__(self):
        return "<Stroke %s>" % (str(self.ident))
    
    def __len__(self):
        """Returns the length of this stroke in number of points"""
        return len(self.Points)

    def __init__(self, points=None, id = None, board=None):#, smoothing=False): DEPRECATED
        # call parent constructor
        AnnotatableObject.__init__(self) 
        # give each stroke a unique ident
        if id != None:
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:33,代码来源:Stroke.py

示例9: ChartAreaAnnotation

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from Utils import Logger
from Utils.GeomUtils import ellipseAxisRatio, pointDist
from Utils.LaTexCalculation import solveLaTex
from xml.etree import ElementTree as ET
import math
import pdb
from Utils.GeomUtils import strokelistBoundingBox

from SketchFramework.Point import Point
from SketchFramework.Stroke import Stroke
from SketchFramework.Board import BoardObserver
from SketchFramework.Annotation import Annotation, AnnotatableObject



logger = Logger.getLogger('ChartObserver', Logger.DEBUG)

#-------------------------------------
class ChartAreaAnnotation(Annotation):
    def __init__(self, horizArrow, vertArrow):
        Annotation.__init__(self)
        self.horizontalArrow = horizArrow
        self.verticalArrow = vertArrow
        self.equations = []


    def __repr__(self):
        return "CA: H {}, V {}".format(self.horizontalArrow, self.verticalArrow)

#-------------------------------------
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:32,代码来源:ChartObserver.py

示例10: DiGraphNodeAnnotation

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from Utils import Logger
from Utils import GeomUtils

from SketchFramework.Point import Point
from SketchFramework.Stroke import Stroke
from SketchFramework.Board import BoardObserver
from SketchFramework.Annotation import Annotation, AnnotatableObject

from Observers import CircleObserver
from Observers import ArrowObserver
from Observers import ObserverBase

from xml.etree import ElementTree as ET


logger = Logger.getLogger('DiGraphObserver', Logger.WARN)
node_log = Logger.getLogger('DiGraphNode', Logger.WARN)

#-------------------------------------
class DiGraphNodeAnnotation(CircleObserver.CircleAnnotation):
    
    def __init__(self, circularity, center, radius):
        #Reminder, CircleAnno has fields:
        #   center
        CircleObserver.CircleAnnotation.__init__(self, circularity, center, radius)
        node_log.debug("Creating new Node")

#-------------------------------------

class NodeMarker( BoardObserver ):
    "Watches for Circle, and annotates them with the circularity, center and the radius"
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:33,代码来源:DiGraphObserver.py

示例11: BoardObserver

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
import datetime 

from SketchFramework.Stroke import Stroke

from Utils import Logger
from Utils import GeomUtils
from Utils.Hacks import type

logger = Logger.getLogger('Board', Logger.DEBUG )

#--------------------------------------------
class BoardObserver(object):
    "The Board Observer Class from which all other Board Observers should be derived"
    def __init__(self):
        self.AnnoFuncs={}
        
    def onStrokeAdded( self, stroke ):
        pass
    
    def onStrokeRemoved( self, stroke ):
        pass
    
    def onStrokeEdited( self, oldStroke, newStroke ):
        pass
    
    def onAnnotationAdded( self, obj, annotation ):
        pass

    def onAnnotationUpdated( self, annotation ):
        pass
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:32,代码来源:Board.py

示例12: drawCurve

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
                self.drawLine(prev_p.X, prev_p.Y, next_p.X, next_p.Y, width=width, color=color)
            prev_p = next_p

    def drawCurve(self, curve, width=2, color="#000000"):
        "Draw a curve on the board with width and color as specified"
        self.drawStroke(curve.toStroke(), width=width, color=color)
        colorwheel = ["#FF0000", "#00FF00", "#0000FF", "#FF00FF"]
        for i, pt in enumerate(curve.getControlPoints()):
            color = colorwheel[i]
            self.drawCircle(pt.X, pt.Y, radius=1, width=width, color=color)

        pt = curve.getControlPoints()[0]
        self.drawCircle(pt.X, pt.Y, radius=2, width=width, color="#0000FF")


dummylog = Logger.getLogger("DummyGUI", Logger.DEBUG)


class DummyGUI(_SketchGUI):
    """A Dummy GUI subclass that is only used as a black hole for method calls"""

    def getDimensions(self):
        return (0, 0)

    def __init__(self):
        dummylog.info("GUI Object created")

    def drawCircle(self, x, y, radius=1, color="#000000", fill="", width=1.0):
        dummylog.warn("Circle to be drawn")

    def drawLine(self, x1, y1, x2, y2, width=2, color="#000000"):
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:33,代码来源:SketchGUI.py

示例13: getFillPoints

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from Utils import Logger
from multiprocessing.queues import Queue
import Image
import commands
import cv
import multiprocessing
import numpy
import os
import threading
import time

log = Logger.getLogger("ImUtil", Logger.DEBUG)
######################################
# Image Manipulation
######################################
def getFillPoints(image):
    """Generate points from which iterative flood fill would cover all non-zero pixels
    in image."""
    image = cv.CloneMat(image)
    retList = []
    _, maxVal, _ , maxLoc = cv.MinMaxLoc(image)
    while maxVal > 0:
        retList.append(maxLoc)
        cv.FloodFill(image, maxLoc, 0)
        _, maxVal, _, maxLoc = cv.MinMaxLoc(image)
    return retList


def resizeImage(img, scale=None, dims=None):
    """Return a resized copy of the image for either relative
    scale, or that matches the dimensions given"""
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:33,代码来源:ImageUtils.py

示例14: FileResponseThread

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from sketchvision.ImageStrokeConverter import imageBufferToStrokes, GETNORMWIDTH
from Utils.StrokeStorage import StrokeStorage
from Utils import Logger

from Observers.ObserverBase import Animator

# Constants
WIDTH = 1024
HEIGHT = 3 * WIDTH / 4

MID_W = WIDTH/2
MID_H = HEIGHT/2

   
logger = Logger.getLogger("DebugSketchGUI", Logger.DEBUG)



class FileResponseThread(threading.Thread):
    def __init__(self, inQ, outQ, filename = "xmlout.xml"):
        threading.Thread.__init__(self)
        self.daemon = True
        self.fname = filename
        self.inQ = inQ
        self.outQ = outQ


    def run(self):
       while True:
            image = self.inQ.get()
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:32,代码来源:debugServer.py

示例15: RubineAnnotation

# 需要导入模块: from Utils import Logger [as 别名]
# 或者: from Utils.Logger import getLogger [as 别名]
from Utils import Rubine

from Observers import CircleObserver
from Observers import LineObserver
from Observers import ObserverBase

from SketchFramework.Point import Point
from SketchFramework.Stroke import Stroke
from SketchFramework.Board import BoardObserver
from SketchFramework.Annotation import Annotation, AnnotatableObject

from xml.etree import ElementTree as ET

from numpy  import *

logger = Logger.getLogger('RubineObserver', Logger.DEBUG )

#-------------------------------------

class RubineAnnotation(Annotation):
    def __init__(self, scores):
        "Create a Rubin annotation."
        Annotation.__init__(self)
        #self.type = type # Deprecated
        #self.accuracy = accuracy Deprecated
        #self.scale = scale # Deprecated
        self.scores = scores
        self.name = ""
        if len(self.scores) > 0:
            self.name = scores[0]['symbol']
    
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:32,代码来源:RubineObserver.py


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