Show
Ignore:
Timestamp:
04/04/09 01:16:51 (4 years ago)
Author:
lmajano
Message:

cfcUnit dropped
Miscellanous refactoring for code generation and unit testing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • coldbox/trunk/system/logging/AbstractLogger.cfc

    r2091 r2173  
    1616        <cfscript> 
    1717                instance = structnew(); 
     18                /* Logger Name */ 
     19                instance.name = ""; 
     20                /* Logger Unique ID */ 
     21                instance._hash = ""; 
     22                /* Flag denoting if the logger is inited or not */ 
     23                instance.isLoggerInitialized = false; 
     24                /* The log levels map */ 
     25                instance.logLevels = structnew(); 
     26                /* The current set logging level */ 
     27                instance.logLevel = 0;           
     28                /* Logger Configuration Properties */ 
     29                instance.properties = structnew();                       
    1830        </cfscript> 
    1931         
    2032        <!--- Init ---> 
    2133        <cffunction name="init" access="public" returntype="AbstractLogger" hint="Constructor" output="false" > 
    22                 <cfargument name="name"  type="string" required="true" hint="The logger identification name"> 
     34                <!--- ************************************************************* ---> 
     35                <cfargument name="name"                 type="string" required="true"  hint="The logger identification name"> 
     36                <cfargument name="properties"   type="struct" required="false" default="#structnew()#" hint="A map of configuration properties for the logger"/> 
     37                <!--- ************************************************************* ---> 
    2338                <cfscript> 
    24                         /* Create the identification name */ 
     39                        /* Prepare Instance */ 
    2540                        instance.name = arguments.name; 
    26                         /* Unique Instance ID for the object. */ 
    27                         instance._hash = hash(createUUID()&instance.name); 
    28                         /* Flag denoting if the logger is inited or not */ 
    29                         instance.isLoggerInitialized = false; 
    30                         /* The log levels map */ 
    31                         instance.logLevels = structnew(); 
    32                         /* The current set logging level */ 
    33                         instance.logLevel = 0;           
    34                         /* Logger Configuration Properties */ 
    35                         instance.properties = structnew(); 
    36                          
     41                        instance._hash = hash(createUUID()&instance.name);       
     42                        instance.properties = arguments.properties;              
    3743                        return this; 
    3844                </cfscript> 
     
    4652 
    4753        <!--- Get/Set Logger Name ---> 
    48         <cffunction name="getname" access="public" output="false" returntype="string" hint="Get name"> 
     54        <cffunction name="getname" access="public" output="false" returntype="string" hint="Get the logger's name"> 
    4955                <cfreturn instance.name/> 
    5056        </cffunction> 
    51         <cffunction name="setname" access="public" output="false" returntype="void" hint="Set name"> 
     57        <cffunction name="setname" access="public" output="false" returntype="void" hint="Set/Override the logger's name"> 
    5258                <cfargument name="name" type="string" required="true"/> 
    5359                <cfset instance.name = arguments.name/> 
     
    126132         
    127133        <!--- Log An Entry ---> 
    128         <cffunction name="logEntry" access="public" hint="Log a message" output="false" returntype="void"> 
     134        <cffunction name="logEntry" access="public" output="false" returntype="void" hint="Log a message"> 
    129135                <!--- ************************************************************* ---> 
    130136                <cfargument name="Severity"             type="string"   required="yes" hint="The severity level to log">