net.wotonomy.foundation
Class NSLog

java.lang.Object
  extended by net.wotonomy.foundation.NSLog

public class NSLog
extends java.lang.Object

NSLog is foundation's built-in logging facility: IMPLEMENTED, BUT NOT TESTED. By default, all groups are enabled, and debug level is DebugLevelOff.

Version:
$Revision: 893 $
Author:
michael@mpowers.net, $Author: cgruber $

Nested Class Summary
static class NSLog.Logger
          The abstract superclass of all Logger implementations.
static class NSLog.PrintStreamLogger
          The default implementation of Logger that writes to a Java PrintStream.
 
Field Summary
static NSLog.Logger debug
          The logger to which debug statements should be conditionally written.
static long DebugGroupApplicationGeneration
           
static long DebugGroupArchiving
           
static long DebugGroupAssociations
           
static long DebugGroupComponentBindings
           
static long DebugGroupComponents
           
static long DebugGroupControllers
           
static long DebugGroupDatabaseAccess
           
static long DebugGroupDeployment
           
static long DebugGroupEnterpriseObjects
           
static long DebugGroupFormatting
           
static long DebugGroupIO
           
static long DebugGroupJSPServlets
           
static long DebugGroupKeyValueCoding
           
static long DebugGroupModel
           
static long DebugGroupMultithreading
           
static long DebugGroupParsing
           
static long DebugGroupQualifiers
           
static long DebugGroupReflection
           
static long DebugGroupRequestHandling
           
static long DebugGroupResources
           
static long DebugGroupRules
           
static long DebugGroupSQLGeneration
           
static long DebugGroupTiming
           
static long DebugGroupUserInterface
           
static long DebugGroupValidation
           
static long DebugGroupWebObjects
           
static long DebugGroupWebServices
           
static int DebugLevelCritical
           
static int DebugLevelDetailed
           
static int DebugLevelInformational
           
static int DebugLevelOff
           
static NSLog.Logger err
          The logger to which error messages should be written, which may not always be user-visible.
static NSLog.Logger out
          The logger to which user-visible messages should be written.
 
Constructor Summary
NSLog()
           
 
Method Summary
static void allowDebugLoggingForGroups(long aDebugGroups)
          Adds the specified group masks to those allowed for logging.
static int allowedDebugLevel()
          Returns the current logging debug level.
static boolean debugLoggingAllowedForGroups(long aDebugGroups)
          Returns whether logging is allowed for the specified groups masks.
static boolean debugLoggingAllowedForLevel(int aDebugLevel)
          Returns whether logging is allowed for the specified level.
static boolean debugLoggingAllowedForLevelAndGroups(int aDebugLevel, long aDebugGroups)
          Returns whether logging allowed for the specified groups masks at the specified level.
static java.io.PrintStream printStreamForPath(java.lang.String aPath)
          Convenience to obtain a java PrintStream for the specified file path.
static void refuseDebugLoggingForGroups(long aDebugGroups)
          Removes the specified group masks from those allowed for logging.
static void setAllowedDebugGroups(long aDebugGroups)
          Sets the allowed groups to only those specified by the mask.
static void setAllowedDebugLevel(int aDebugLevel)
          Sets the current debug level.
static void setDebug(NSLog.Logger logger)
          Sets the current debug logger.
static void setErr(NSLog.Logger logger)
          Sets the current error logger.
static void setOut(NSLog.Logger logger)
          Sets the current output logger.
static java.lang.String throwableAsString(java.lang.Throwable t)
          Convenience to write the throwable's stack trace to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DebugGroupApplicationGeneration

public static long DebugGroupApplicationGeneration

DebugGroupArchiving

public static long DebugGroupArchiving

DebugGroupAssociations

public static long DebugGroupAssociations

DebugGroupComponentBindings

public static long DebugGroupComponentBindings

DebugGroupControllers

public static long DebugGroupControllers

DebugGroupComponents

public static long DebugGroupComponents

DebugGroupDatabaseAccess

public static long DebugGroupDatabaseAccess

DebugGroupDeployment

public static long DebugGroupDeployment

DebugGroupEnterpriseObjects

public static long DebugGroupEnterpriseObjects

DebugGroupFormatting

public static long DebugGroupFormatting

DebugGroupIO

public static long DebugGroupIO

DebugGroupJSPServlets

public static long DebugGroupJSPServlets

DebugGroupKeyValueCoding

public static long DebugGroupKeyValueCoding

DebugGroupModel

public static long DebugGroupModel

DebugGroupMultithreading

public static long DebugGroupMultithreading

DebugGroupParsing

public static long DebugGroupParsing

DebugGroupQualifiers

public static long DebugGroupQualifiers

DebugGroupReflection

public static long DebugGroupReflection

DebugGroupRequestHandling

public static long DebugGroupRequestHandling

DebugGroupResources

public static long DebugGroupResources

DebugGroupRules

public static long DebugGroupRules

DebugGroupSQLGeneration

public static long DebugGroupSQLGeneration

DebugGroupTiming

public static long DebugGroupTiming

DebugGroupUserInterface

public static long DebugGroupUserInterface

DebugGroupValidation

public static long DebugGroupValidation

DebugGroupWebObjects

public static long DebugGroupWebObjects

DebugGroupWebServices

public static long DebugGroupWebServices

DebugLevelOff

public static int DebugLevelOff

DebugLevelCritical

public static int DebugLevelCritical

DebugLevelInformational

public static int DebugLevelInformational

DebugLevelDetailed

public static int DebugLevelDetailed

debug

public static NSLog.Logger debug
The logger to which debug statements should be conditionally written. By default, these messages appear on the standard error stream.


err

public static NSLog.Logger err
The logger to which error messages should be written, which may not always be user-visible. By default, these messages appear on the standard error stream.


out

public static NSLog.Logger out
The logger to which user-visible messages should be written. By default, these messages appear on the standard output stream.

Constructor Detail

NSLog

public NSLog()
Method Detail

allowDebugLoggingForGroups

public static void allowDebugLoggingForGroups(long aDebugGroups)
Adds the specified group masks to those allowed for logging.


allowedDebugLevel

public static int allowedDebugLevel()
Returns the current logging debug level.


debugLoggingAllowedForGroups

public static boolean debugLoggingAllowedForGroups(long aDebugGroups)
Returns whether logging is allowed for the specified groups masks.


debugLoggingAllowedForLevel

public static boolean debugLoggingAllowedForLevel(int aDebugLevel)
Returns whether logging is allowed for the specified level.


debugLoggingAllowedForLevelAndGroups

public static boolean debugLoggingAllowedForLevelAndGroups(int aDebugLevel,
                                                           long aDebugGroups)
Returns whether logging allowed for the specified groups masks at the specified level. Convenience method.


printStreamForPath

public static java.io.PrintStream printStreamForPath(java.lang.String aPath)
Convenience to obtain a java PrintStream for the specified file path. Returns null if the stream could not be created.


refuseDebugLoggingForGroups

public static void refuseDebugLoggingForGroups(long aDebugGroups)
Removes the specified group masks from those allowed for logging.


setAllowedDebugGroups

public static void setAllowedDebugGroups(long aDebugGroups)
Sets the allowed groups to only those specified by the mask.


setAllowedDebugLevel

public static void setAllowedDebugLevel(int aDebugLevel)
Sets the current debug level.


setDebug

public static void setDebug(NSLog.Logger logger)
Sets the current debug logger. Does nothing if logger is null.


setErr

public static void setErr(NSLog.Logger logger)
Sets the current error logger. Does nothing if logger is null.


setOut

public static void setOut(NSLog.Logger logger)
Sets the current output logger. Does nothing if logger is null.


throwableAsString

public static java.lang.String throwableAsString(java.lang.Throwable t)
Convenience to write the throwable's stack trace to a string.



Copyright © 2006 null. All Rights Reserved.