Ejemplo n.º 1
0
def getLogger(name):
    """
    Returns a named logger instance.  The logger is an Apache commons Log instance:
    http://commons.apache.org/logging/commons-logging-1.1.1/apidocs/org/apache/commons/logging/Log.html
    """
    return HappyLogger.getLogger(name)
Ejemplo n.º 2
0
def setLevel(level):
    """
    Sets the Happy debugging level.  Level names are, in order, "trace", "debug", "info", "warn", "error", and "fatal".
    These correspond to the Apache Log4J and Apache commons levels.
    """
    HappyLogger.setLevel(level)
Ejemplo n.º 3
0
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METAWEB TECHNOLOGIES BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ========================================================================
#

from com.freebase.happy import HappyLogger

# the default log instance:
logger = HappyLogger.getLogger()

def getLogger(name):
    """
    Returns a named logger instance.  The logger is an Apache commons Log instance:
    http://commons.apache.org/logging/commons-logging-1.1.1/apidocs/org/apache/commons/logging/Log.html
    """
    return HappyLogger.getLogger(name)

def setLevel(level):
    """
    Sets the Happy debugging level.  Level names are, in order, "trace", "debug", "info", "warn", "error", and "fatal".
    These correspond to the Apache Log4J and Apache commons levels.
    """
    HappyLogger.setLevel(level)