forked from apache/mahout
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAHOUT-1660 MAHOUT-1713 MAHOUT-1714 MAHOUT-1715 MAHOUT-1716 MAHOUT-17…
…17 MAHOUT-1718 MAHOUT-1719 MAHOUT-1720 MAHOUT-1721 MAHOUT-1722 MAHOUT-1723 MAHOUT-1724 MAHOUT-1725 MAHOUT-1726 MAHOUT-1727 MAHOUT-1728 MAHOUT-1729 MAHOUT-1730 MAHOUT-1731 MAHOUT-1732 Cumulative patch for the above issues. Closes apache#135 Squashed commit of the following: commit c59bf8a Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Mon Jun 8 18:11:57 2015 -0700 handling degenerate matrix cases for rbind, cbind, and serialization (0 columns or rows) commit 56b735e Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Mon Jun 8 16:58:34 2015 -0700 Inserting back the testing framework artifact being built. Need this as a dependency in subordinate projects that do method testing as well. commit 7e6ce76 Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Mon Jun 8 10:22:53 2015 -0700 adding "final" for logger per comment on public PR commit e42bced Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Tue Jun 2 12:24:30 2015 -0700 final fixes in h20. fixing @deprecated warnings in atb commit 00fb618 Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Tue Jun 2 12:08:13 2015 -0700 h20 stuff commit f4e1550 Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Tue Jun 2 11:55:30 2015 -0700 restoring merge errors in h2o module, nothing is touched here. commit 1b892de Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Mon Jun 1 18:44:21 2015 -0700 Picking up missing changes on both sides in spark module. TODO: Pat's similarity driver tests fail, seems, on some degenerate splitting in optimizer. Need to take a look. commit 3422046 Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Mon Jun 1 18:13:03 2015 -0700 Adding missing change. uncommenting performance in-core tests. commit 7aa5de5 Author: Dmitriy Lyubimov <dlyubimov@apache.org> Date: Mon Jun 1 17:54:17 2015 -0700 Initial merge with ora private-review branch. Stuff compiles up to h2o (which needs to be added some unimplemented stuff) and ssvd tests are failing in math-scala module due to lack of matrix flavor on mmul. They are not failing in private branch though -- some changes still have not been merged? Most changes i care about seems to be there though.
- Loading branch information
Showing
107 changed files
with
4,251 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
math-scala/src/main/scala/org/apache/mahout/logging/package.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.mahout | ||
|
||
import org.apache.log4j.{Level, Priority, Logger} | ||
|
||
package object logging { | ||
|
||
/** Compute `expr` if debug is on, only */ | ||
def debugDo[T](expr: => T)(implicit log: Logger): Option[T] = { | ||
if (log.isDebugEnabled) Some(expr) | ||
else None | ||
} | ||
|
||
/** Compute `expr` if trace is on, only */ | ||
def traceDo[T](expr: => T)(implicit log: Logger): Option[T] = { | ||
if (log.isTraceEnabled) Some(expr) else None | ||
} | ||
|
||
/** Shorter, and lazy, versions of logging methods. Just declare log implicit. */ | ||
def debug(msg: => AnyRef)(implicit log: Logger) { if (log.isDebugEnabled) log.debug(msg) } | ||
|
||
def debug(msg: => AnyRef, t: Throwable)(implicit log: Logger) { if (log.isDebugEnabled()) log.debug(msg, t) } | ||
|
||
/** Shorter, and lazy, versions of logging methods. Just declare log implicit. */ | ||
def trace(msg: => AnyRef)(implicit log: Logger) { if (log.isTraceEnabled) log.trace(msg) } | ||
|
||
def trace(msg: => AnyRef, t: Throwable)(implicit log: Logger) { if (log.isTraceEnabled()) log.trace(msg, t) } | ||
|
||
def info(msg: => AnyRef)(implicit log: Logger) { if (log.isInfoEnabled) log.info(msg)} | ||
|
||
def info(msg: => AnyRef, t:Throwable)(implicit log: Logger) { if (log.isInfoEnabled) log.info(msg,t)} | ||
|
||
def warn(msg: => AnyRef)(implicit log: Logger) { if (log.isEnabledFor(Level.WARN)) log.warn(msg) } | ||
|
||
def warn(msg: => AnyRef, t: Throwable)(implicit log: Logger) { if (log.isEnabledFor(Level.WARN)) error(msg, t) } | ||
|
||
def error(msg: => AnyRef)(implicit log: Logger) { if (log.isEnabledFor(Level.ERROR)) log.warn(msg) } | ||
|
||
def error(msg: => AnyRef, t: Throwable)(implicit log: Logger) { if (log.isEnabledFor(Level.ERROR)) error(msg, t) } | ||
|
||
def fatal(msg: => AnyRef)(implicit log: Logger) { if (log.isEnabledFor(Level.FATAL)) log.fatal(msg) } | ||
|
||
def fatal(msg: => AnyRef, t: Throwable)(implicit log: Logger) { if (log.isEnabledFor(Level.FATAL)) log.fatal(msg, t) } | ||
|
||
def getLog(name: String): Logger = Logger.getLogger(name) | ||
|
||
def getLog(clazz: Class[_]): Logger = Logger.getLogger(clazz) | ||
|
||
def mahoutLog :Logger = getLog("org.apache.mahout") | ||
|
||
def setLogLevel(l:Level)(implicit log:Logger) = { | ||
log.setLevel(l) | ||
} | ||
|
||
def setAdditivity(a:Boolean)(implicit log:Logger) = log.setAdditivity(a) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.