PgLog
Namespace: Ankus
Assembly: Ankus.Runtime.dll
Reports through PostgreSQL’s client and server diagnostics on the active backend thread.
public static class PgLogInheritance: object
Methods
Section titled “Methods”Debug1(PgDiagnostic)
Section titled “Debug1(PgDiagnostic)”Reports debugging text at detail level one.
public static void Debug1(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Debug1(string)
Section titled “Debug1(string)”Reports debugging text at detail level one.
public static void Debug1(string message)Parameters:
message — string
The primary message, treated as literal text.
Debug2(PgDiagnostic)
Section titled “Debug2(PgDiagnostic)”Reports debugging text at detail level two.
public static void Debug2(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Debug2(string)
Section titled “Debug2(string)”Reports debugging text at detail level two.
public static void Debug2(string message)Parameters:
message — string
The primary message, treated as literal text.
Debug3(PgDiagnostic)
Section titled “Debug3(PgDiagnostic)”Reports debugging text at detail level three.
public static void Debug3(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Debug3(string)
Section titled “Debug3(string)”Reports debugging text at detail level three.
public static void Debug3(string message)Parameters:
message — string
The primary message, treated as literal text.
Debug4(PgDiagnostic)
Section titled “Debug4(PgDiagnostic)”Reports debugging text at detail level four.
public static void Debug4(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Debug4(string)
Section titled “Debug4(string)”Reports debugging text at detail level four.
public static void Debug4(string message)Parameters:
message — string
The primary message, treated as literal text.
Debug5(PgDiagnostic)
Section titled “Debug5(PgDiagnostic)”Reports debugging text at detail level five.
public static void Debug5(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Debug5(string)
Section titled “Debug5(string)”Reports debugging text at detail level five.
public static void Debug5(string message)Parameters:
message — string
The primary message, treated as literal text.
Error(PgDiagnostic)
Section titled “Error(PgDiagnostic)”Throws a catchable PostgreSQL error after validating the active logging capability.
[DoesNotReturn]public static void Error(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
The default SQLSTATE is XX000. Explicit diagnostic fields and codes retain their meaning. An unhandled error is raised by PostgreSQL after managed frames unwind.
Error(string)
Section titled “Error(string)”Throws a catchable PostgreSQL error after validating the active logging capability.
[DoesNotReturn]public static void Error(string message)Parameters:
message — string
The primary message, treated as literal text.
The default SQLSTATE is XX000. Explicit diagnostic fields and codes retain their meaning. An unhandled error is raised by PostgreSQL after managed frames unwind.
Fatal(PgDiagnostic)
Section titled “Fatal(PgDiagnostic)”Records a terminal report and unwinds managed code before PostgreSQL terminates the connection.
[DoesNotReturn]public static void Fatal(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
The default SQLSTATE is XX000. Explicit diagnostic fields and codes retain their meaning. Catching the managed exception does not discard the terminal report.
Fatal(string)
Section titled “Fatal(string)”Records a terminal report and unwinds managed code before PostgreSQL terminates the connection.
[DoesNotReturn]public static void Fatal(string message)Parameters:
message — string
The primary message, treated as literal text.
The default SQLSTATE is XX000. Explicit diagnostic fields and codes retain their meaning. Catching the managed exception does not discard the terminal report.
Info(PgDiagnostic)
Section titled “Info(PgDiagnostic)”Reports information to the client regardless of client_min_messages.
public static void Info(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Info(string)
Section titled “Info(string)”Reports information to the client regardless of client_min_messages.
public static void Info(string message)Parameters:
message — string
The primary message, treated as literal text.
IsEnabled(PgLogLevel)
Section titled “IsEnabled(PgLogLevel)”Tests PostgreSQL’s current reporting thresholds before formatting a message.
public static bool IsEnabled(PgLogLevel level)Parameters:
level — PgLogLevel
The reporting severity.
Returns: bool
Whether PostgreSQL would process this level for either destination.
Log(PgDiagnostic)
Section titled “Log(PgDiagnostic)”Reports an operational message with PostgreSQL’s LOG routing.
public static void Log(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Log(string)
Section titled “Log(string)”Reports an operational message with PostgreSQL’s LOG routing.
public static void Log(string message)Parameters:
message — string
The primary message, treated as literal text.
Notice(PgDiagnostic)
Section titled “Notice(PgDiagnostic)”Reports an expected event without stopping execution.
public static void Notice(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Notice(string)
Section titled “Notice(string)”Reports an expected event without stopping execution.
public static void Notice(string message)Parameters:
message — string
The primary message, treated as literal text.
Panic(PgDiagnostic)
Section titled “Panic(PgDiagnostic)”Records a terminal report and unwinds managed code before PostgreSQL starts cluster crash recovery.
[DoesNotReturn]public static void Panic(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
The default SQLSTATE is XX000. Explicit diagnostic fields and codes retain their meaning. Catching the managed exception does not discard the terminal report.
Panic(string)
Section titled “Panic(string)”Records a terminal report and unwinds managed code before PostgreSQL starts cluster crash recovery.
[DoesNotReturn]public static void Panic(string message)Parameters:
message — string
The primary message, treated as literal text.
The default SQLSTATE is XX000. Explicit diagnostic fields and codes retain their meaning. Catching the managed exception does not discard the terminal report.
ServerOnly(PgDiagnostic)
Section titled “ServerOnly(PgDiagnostic)”Reports an operational message to the server only.
public static void ServerOnly(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
ServerOnly(string)
Section titled “ServerOnly(string)”Reports an operational message to the server only.
public static void ServerOnly(string message)Parameters:
message — string
The primary message, treated as literal text.
Warning(PgDiagnostic)
Section titled “Warning(PgDiagnostic)”Reports an unexpected event without stopping execution.
public static void Warning(PgDiagnostic diagnostic)Parameters:
diagnostic — PgDiagnostic
The message and optional PostgreSQL diagnostic fields.
Warning(string)
Section titled “Warning(string)”Reports an unexpected event without stopping execution.
public static void Warning(string message)Parameters:
message — string
The primary message, treated as literal text.
Write(PgLogLevel, PgDiagnostic)
Section titled “Write(PgLogLevel, PgDiagnostic)”Reports structured diagnostics using PostgreSQL’s filtering and routing rules. Terminal reports remain pending until the native boundary even if extension code catches their managed exception.
public static void Write(PgLogLevel level, PgDiagnostic diagnostic)Parameters:
level — PgLogLevel
The reporting severity.
diagnostic — PgDiagnostic
The message and optional diagnostic fields.
Messages below ERROR defer PostgreSQL interrupts while the native reporter emits the message. Call Check() periodically in loops that otherwise only report messages. Reporting failures still follow the ordinary native error recovery contract.
Write(PgLogLevel, ref PgLogInterpolatedStringHandler)
Section titled “Write(PgLogLevel, ref PgLogInterpolatedStringHandler)”Reports an interpolated message, evaluating and formatting its expressions only when PostgreSQL would report the level, as pgrx’s logging macros do. ERROR throws PgException; FATAL and PANIC unwind to the generated native boundary before reporting.
public static void Write(PgLogLevel level, ref PgLogInterpolatedStringHandler message)Parameters:
level — PgLogLevel
The reporting severity.
message — PgLogInterpolatedStringHandler
The interpolated primary message.
Write(PgLogLevel, string)
Section titled “Write(PgLogLevel, string)”Reports literal text. ERROR throws PgException; FATAL and PANIC unwind to the generated native boundary before reporting.
public static void Write(PgLogLevel level, string message)Parameters:
level — PgLogLevel
The reporting severity.
message — string
The primary message.