Logger object, for inserting code that prints/saves information to files.

Not implemented, please ignore

If set, instead of printing, will insert code for writing output to this file

Hierarchy (view full)

Constructors

Properties

afterJp: undefined | Joinpoint
currentElements: ElementType[]
filename: undefined | string
isGlobal: boolean
printfFormat: Record<number, undefined | string>

Used for both C and Java printf functions

Type: Map<string, number>

Methods

  • ** PRIVATE METHODS ***

    Parameters

    • message: string | Joinpoint
    • Optionaltype: number

    Returns this

  • Parameters

    • functionId: string
    • nameGenerator: (() => string)

      Function that receives no arguments and generates a new name

        • (): string
        • Returns string

    Returns {
        alreadyDeclared: boolean;
        name: string;
    }

    • alreadyDeclared: boolean
    • name: string
  • Parameters

    • element: ElementType

    Returns string

  • Parameters

    • message: string

    Returns void

  • Parameters

    • $jp: Joinpoint
    • insertBefore: boolean
    • code: string

    Returns void

  • Checks the initial constrains before executing the actual log (ancestor function, minimum of elements to log, defines the value of insertBefore) Should be called on the beggining of each implementation of log

    Parameters

    Returns undefined | FunctionJp

    Undefined on failure and a $function instance if successful

  • Generates printf like code for c and java

    Parameters

    • printFunctionName: string

      The name of the function to use (printf for C, System.out.println for Java)

    • Optionalprefix: string
    • Optionalsuffix: string
    • Optionaldelimiter: string

    Returns string

  • Verifies that the given $jp is inside a function.

    Requires global attribute 'ancestor'.

    Parameters

    • $jp: any
    • OptionalfunctionJpName: string

    Returns boolean

    true if $jp is inside a function, false otherwise

  • Parameters

    • message: string

    Returns void

  • Appends the given string to the current buffer.

    Parameters

    • text: string

      The text to append

    Returns this

    The current logger instance

  • Appends an expression that represents a char.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Appends an expression that represents a double.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Appends an expression that represents a hex number.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Appends an expression that represents a int.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The same as 'append', but adds a new line at the end of the buffer.

    Parameters

    • text: string

      the text to append

    Returns this

    The current logger instance

  • Appends an expression that represents a long.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Appends an expression that represents an octal.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Appends an expression that represents a string.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The same as 'appendChar'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The same as 'appendDouble'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The 'last' join point after .log() is called.

    Returns undefined | Joinpoint

  • The same as 'appendHex'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The same as 'appendInt'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Returns void

  • Appends a new line to the buffer.

    Returns this

    The current logger instance

  • Helper method which call 'log' with 'insertBefore' set to true

    Parameters

    Returns void

  • The same as 'appendLong'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The same as 'appendOctal'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • The same as 'appendString'.

    Parameters

    • expr: string | Joinpoint

      The expression to append

    Returns this

    The current logger instance

  • Appends a tab to the buffer.

    Returns this

    The current logger instance

  • The same as 'append'.

    Parameters

    • text: string

      the text to append

    Returns this

    The current logger instance