Search Results for

    Show / Hide Table of Contents

    Class ParserFeedback

    Utility class is responsible for collecting feedback lines, such as warnings,error or info text to either the console window, visual-studio output/debug window, to a file structure or all.

    The class makes it easy to switch between displaying output to a console while debugging while to outputting to file when code moves to a server. Suitable for collecting debugging info from services that run many cases repeatedly.

    log levels: INFO,WARN,ERROR,FATAL (no debug messages here)

    Inheritance
    object
    ParserFeedback
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: TimeSeriesAnalysis.Utility
    Assembly: TimeSeriesAnalysis.dll
    Syntax
    public class ParserFeedback

    Constructors

    | Edit this page View Source

    ParserFeedback(bool)

    Constructor

    Declaration
    public ParserFeedback(bool doOutputAlsoToConsole = false)
    Parameters
    Type Name Description
    bool doOutputAlsoToConsole

    Methods

    | Edit this page View Source

    AddError(string)

    Add an error message

    Declaration
    public void AddError(string message)
    Parameters
    Type Name Description
    string message
    | Edit this page View Source

    AddFatalError(string)

    Adds a fatal error

    Declaration
    public void AddFatalError(string message)
    Parameters
    Type Name Description
    string message
    | Edit this page View Source

    AddInfo(string)

    Adds an info message

    Declaration
    public void AddInfo(string message)
    Parameters
    Type Name Description
    string message
    | Edit this page View Source

    AddWarning(string)

    Adds a warning

    Declaration
    public void AddWarning(string message)
    Parameters
    Type Name Description
    string message
    | Edit this page View Source

    Close()

    Flushes all messages to file and closes file handlers.

    Declaration
    public void Close()
    | Edit this page View Source

    CloseCaseLogFile()

    Close a log file belong to a perticular case

    Declaration
    public void CloseCaseLogFile()
    | Edit this page View Source

    CreateCaseLogFile(string, int)

    Creates a new empty log file for a specific case name. Calling this function before StoreMessage will cause all messages to be copied to it.

    Declaration
    public void CreateCaseLogFile(string caseName, int caseNum)
    Parameters
    Type Name Description
    string caseName
    int caseNum
    | Edit this page View Source

    CreateCommonHTMLfile()

    Creates a html file, where is "case" is presented in an iframe- useful for quickly viewing many cases Needs SetCaseArray to be called first

    Declaration
    public void CreateCommonHTMLfile()
    | Edit this page View Source

    CreateCommonLogFile(string)

    Creates a new empty log file and, resets counters etc. This is a "common" file if no cases are specificed

    Declaration
    public void CreateCommonLogFile(string loggDir)
    Parameters
    Type Name Description
    string loggDir
    | Edit this page View Source

    EnableConsoleOutput(bool)

    Enable (or disable) console output - i.e. writing messages directly to screen (useful for debugging, but leave off if running on a server)

    Declaration
    public void EnableConsoleOutput(bool doEnable = true)
    Parameters
    Type Name Description
    bool doEnable
    | Edit this page View Source

    EnableDebugOutput(bool)

    Enables or disables the output to Visual Studio debug window and to console out

    Declaration
    public void EnableDebugOutput(bool doEnable = true)
    Parameters
    Type Name Description
    bool doEnable
    | Edit this page View Source

    GetFirstErrorOrWarning()

    Intended for unit tests, get the first error or warning message

    Declaration
    public string GetFirstErrorOrWarning()
    Returns
    Type Description
    string
    | Edit this page View Source

    GetListOfAllLogLinesAtOrAboveLevel(ParserfeedbackMessageLevel)

    Returns all log lines at or above a specified level

    Declaration
    public List<string> GetListOfAllLogLinesAtOrAboveLevel(ParserfeedbackMessageLevel desiredLevel = ParserfeedbackMessageLevel.warn)
    Parameters
    Type Name Description
    ParserfeedbackMessageLevel desiredLevel
    Returns
    Type Description
    List<string>
    | Edit this page View Source

    GetListOfAllLogLinesAtOrBelowLevel(ParserfeedbackMessageLevel)

    Returns all log lines at or belowe a specified level

    Declaration
    public List<string> GetListOfAllLogLinesAtOrBelowLevel(ParserfeedbackMessageLevel desiredLevel = ParserfeedbackMessageLevel.warn)
    Parameters
    Type Name Description
    ParserfeedbackMessageLevel desiredLevel
    Returns
    Type Description
    List<string>
    | Edit this page View Source

    GetListOfAllLogLinesOfLevel(ParserfeedbackMessageLevel)

    Returns all log lines of a specified level

    Declaration
    public List<string> GetListOfAllLogLinesOfLevel(ParserfeedbackMessageLevel desiredLevel)
    Parameters
    Type Name Description
    ParserfeedbackMessageLevel desiredLevel
    Returns
    Type Description
    List<string>
    | Edit this page View Source

    GetLogFilePath()

    Returns the path to which log files are written

    Declaration
    public string GetLogFilePath()
    Returns
    Type Description
    string
    | Edit this page View Source

    GetLogFilename()

    Returns the name of the current log file

    Declaration
    public string GetLogFilename()
    Returns
    Type Description
    string
    | Edit this page View Source

    IsNumberOfErrorsAndWarningsZero()

    For testing, this is a way to check that no errors or warnings have been given.

    Declaration
    public bool IsNumberOfErrorsAndWarningsZero()
    Returns
    Type Description
    bool
    | Edit this page View Source

    ResetCounters()

    Reset all error and warning counters

    Declaration
    public void ResetCounters()
    | Edit this page View Source

    SetCaseArray(string[])

    If output is to be divided into multiple log files, set the names of each "case"

    Declaration
    public void SetCaseArray(string[] caseArray)
    Parameters
    Type Name Description
    string[] caseArray
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX