There are 19 code examples for java.util.logging.Level.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: CodeAnalyzer Package: de.fzi.cloneanalyzer.util
Source Code: FileConsoleLogger.java (Click to view .java file)
Method Code:
public void init(String filename){
try {
FileHandler fh=new FileHandler(filename,true);
fh.setFormatter(new SimpleFormatter());
fh.setLevel(Level.FINE);
addHandler(fh);
}
catch ( Exception e) {
e.printStackTrace();
}
ConsoleHandler ch=new ConsoleHandler();
ch.setLevel(Level.FINEST);
addHandler(ch);
}
Project Name: Java-daemon-code Package: ke.co.pixie.daemon
Source Code: JavaDaemon.java (Click to view .java file)
Method Code:
/**
* Runs the thread. The application runs inside an "infinite" loop.
*/
@Override @SuppressWarnings({"SleepWhileHoldingLock","SleepWhileInLoop"}) public void run(){
int i=0;
while (working) {
try {
DaemonLogger.log(Level.SEVERE,"Test: " + i);
i++;
Thread.sleep(1000);
}
catch ( InterruptedException ex) {
DaemonLogger.log(Level.SEVERE,ex.getMessage());
}
}
}
Project Name: Java-daemon-code Package: ke.co.pixie.daemon.logging
Source Code: DaemonLogger.java (Click to view .java file)
Method Code:
/**
* Logs the message with the specified level.
* @param level the log level
* @param message the message to log
*/
public static void log(final Level level,final String message){
LOGGER.log(level,message);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007
Source Code: LoglinearTranslationFeatures.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tFEATURES: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007
Source Code: RuleApplication.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tRULE-APP: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007
Source Code: Translation.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tTRANSLATION: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.common
Source Code: Translation.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tTRANSLATION: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.common
Source Code: RuleApplication.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tRULE-APP: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.cubepruning
Source Code: RuleApplication.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tRULE-APP: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.cubepruning
Source Code: Translation.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tTRANSLATION: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.intersection
Source Code: RuleApplication.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tRULE-APP: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.intersection
Source Code: Translation.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tTRANSLATION: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.rescoring
Source Code: Translation.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tTRANSLATION: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: nlp-parsers Package: edu.umn.cs.nlp.mt.chiang2007.rescoring
Source Code: RuleApplication.java (Click to view .java file)
Method Code:
/**
* Convenience method to turn on logging during testing and debugging.
* <p>
* For normal uses, a logging configuration file probably be used instead of this method.
* @param level Level at which to begin logging
*/
static void enableLogging(Level level){
ConsoleHandler handler=new ConsoleHandler();
try {
handler.setEncoding("UTF-8");
}
catch ( SecurityException e) {
}
catch ( UnsupportedEncodingException e) {
}
handler.setFormatter(new Formatter(){
public String format( LogRecord record){
return "\tRULE-APP: " + formatMessage(record) + "\n";
}
}
);
handler.setLevel(Level.ALL);
logger.addHandler(handler);
logger.setLevel(level);
}
Project Name: openhotelsystem Package: it.hotel.system
Source Code: SystemUtils.java (Click to view .java file)
Method Code:
/**
* Traccia una eccezione sul logger del contesto. Se il livello di soglia
* del logger è superiore a FINER, viene emesso solo un breve messaggio di
* livello SEVERE, altrimenti viene tracciato anche lo stack trace della
* eccezione (con il livello FINER).
* @param t L'eccezione da tracciare
* @param caller La classe chiamante, in cui si èverificato l'errore.
* @param methodName Il metodo in cui si è verificato l'errore.
* @param message Testo da includere nel tracciamento.
*/
public static void logThrowable(Throwable t,Object caller,String methodName,String message){
String className=null;
if (caller != null) {
className=caller.getClass().getName();
}
if (_logger.isLoggable(Level.FINER)) {
_logger.throwing(className,methodName,t);
}
_logger.severe(message + " - " + t.toString()+ " in "+ className+ "."+ methodName);
}
Project Name: vfsjfilechooser Package: net.sf.vfsjfilechooser.accessories.bookmarks
Source Code: Bookmarks.java (Click to view .java file)
Method Code:
public void save(){
try {
writer.writeToFile(entries,favorites);
}
catch ( IOException ex) {
logger.log(Level.SEVERE,"Unable to write bookmarks",ex);
}
catch ( Exception e) {
logger.log(Level.SEVERE,"Unable to write bookmarks",e);
}
}
Project Name: vfsjfilechooser Package: net.sf.vfsjfilechooser.plaf.basic
Source Code: BasicVFSFileChooserUI.java (Click to view .java file)
Method Code:
public void actionPerformed(ActionEvent e){
VFSJFileChooser fc=getFileChooser();
FileObject currentDir=fc.getCurrentDirectory();
if (currentDir instanceof LocalFile) {
changeDirectory(fc.getFileSystemView().getHomeDirectory());
}
else {
try {
changeDirectory(fc.getCurrentDirectory().getFileSystem().getRoot());
}
catch ( FileSystemException ex) {
Logger.getLogger(BasicVFSFileChooserUI.class.getName()).log(Level.SEVERE,null,ex);
}
}
}
Project Name: vfsjfilechooser Package: net.sf.vfsjfilechooser.utils
Source Code: VFSResources.java (Click to view .java file)
Method Code:
/**
* Returns a translated message
* @param messageKey The key to translate
* @return a translated message
*/
public static String getMessage(String messageKey){
if (messageKey == null) {
return null;
}
synchronized (resourceBundle) {
String msg=null;
try {
msg=resourceBundle.getString(messageKey);
}
catch ( MissingResourceException ex) {
msg=messageKey + " Untranslated";
LOG.log(Level.SEVERE,"Unable to retrieve i18n key",ex);
}
return msg;
}
}
Project Name: weka Package: weka.core
Source Code: Debug.java (Click to view .java file)
Method Code:
/**
* prints the given message with the specified level
* @param level the level of logging
* @param sourceclass the class that logs the message
* @param sourcemethod the method that logs the message
* @param message the message to print
*/
public void log(Level level,String sourceclass,String sourcemethod,String message){
if (getEnabled()) m_Log.log(level,sourceclass,sourcemethod,message);
}