• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    Interface ICodeLog

    A special logger for dynamic code (Razor, WebApi). It is always available to add messages to insights.

    Namespace: ToSic.Sxc.Code
    Assembly: ToSic.Sxc.dll
    Syntax
    [PublicApi]
    public interface ICodeLog : IWrapper<ILog>
    Remarks

    Added in v15, replaces the then removed ILog interface.

    Methods

    | Improve this Doc View Source

    Add(String, String, String, Int32)

    Add a message log entry

    Declaration
    string Add(string message, string cPath = null, string cName = null, int cLine = 0)
    Parameters
    Type Name Description
    System.String message

    Message to log

    System.String cPath

    auto pre filled by the compiler - the path to the code file

    System.String cName

    auto pre filled by the compiler - the method name

    System.Int32 cLine

    auto pre filled by the compiler - the code line

    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    Call(String, String, Boolean, String, String, Int32)

    Add a log entry for method call, returning a method to call when done

    Declaration
    Action<string> Call(string parameters = null, string message = null, bool useTimer = false, string cPath = null, string cName = null, int cLine = 0)
    Parameters
    Type Name Description
    System.String parameters

    what was passed to the call in the brackets

    System.String message

    the message to log

    System.Boolean useTimer

    enable a timer from call/close

    System.String cPath

    auto pre filled by the compiler - the path to the code file

    System.String cName

    auto pre filled by the compiler - the method name

    System.Int32 cLine

    auto pre filled by the compiler - the code line

    Returns
    Type Description
    System.Action<System.String>
    | Improve this Doc View Source

    Call<T>(String, String, Boolean, String, String, Int32)

    Add a log entry for method call, returning a method to call when done

    Declaration
    Func<T, string, T> Call<T>(string parameters = null, string message = null, bool useTimer = false, string cPath = null, string cName = null, int cLine = 0)
    Parameters
    Type Name Description
    System.String parameters

    what was passed to the call in the brackets

    System.String message

    the message to log

    System.Boolean useTimer

    enable a timer from call/close

    System.String cPath

    auto pre filled by the compiler - the path to the code file

    System.String cName

    auto pre filled by the compiler - the method name

    System.Int32 cLine

    auto pre filled by the compiler - the code line

    Returns
    Type Description
    System.Func<T, System.String, T>
    Type Parameters
    Name Description
    T
    Remarks

    Not used much, but major change in V15 - the first value in the result is the data, the second is the string to log. Before in the ILog it was (message, data), new is (data, message)

    | Improve this Doc View Source

    Exception(Exception, String, String, Int32)

    Add an exception as special log entry

    Declaration
    void Exception(Exception ex, string cPath = null, string cName = null, int cLine = 0)
    Parameters
    Type Name Description
    System.Exception ex

    The Exception object

    System.String cPath

    auto pre filled by the compiler - the path to the code file

    System.String cName

    auto pre filled by the compiler - the method name

    System.Int32 cLine

    auto pre filled by the compiler - the code line

    | Improve this Doc View Source

    Warn(String, String, String, Int32)

    Add a warning log entry

    Declaration
    void Warn(string message, string cPath = null, string cName = null, int cLine = 0)
    Parameters
    Type Name Description
    System.String message
    System.String cPath

    auto pre filled by the compiler - the path to the code file

    System.String cName

    auto pre filled by the compiler - the method name

    System.Int32 cLine

    auto pre filled by the compiler - the code line

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX