1.Dd January 24, 2024 2.Dt SQLITE3_LOG 3 3.Os 4.Sh NAME 5.Nm sqlite3_log 6.Nd error logging interface 7.Sh SYNOPSIS 8.In sqlite3.h 9.Ft void 10.Fo sqlite3_log 11.Fa "int iErrCode" 12.Fa "const char *zFormat" 13.Fa "..." 14.Fc 15.Sh DESCRIPTION 16The 17.Fn sqlite3_log 18interface writes a message into the error log established 19by the SQLITE_CONFIG_LOG option to 20.Fn sqlite3_config . 21If logging is enabled, the zFormat string and subsequent arguments 22are used with 23.Fn sqlite3_snprintf 24to generate the final output string. 25.Pp 26The sqlite3_log() interface is intended for use by extensions such 27as virtual tables, collating functions, and SQL functions. 28While there is nothing to prevent an application from calling sqlite3_log(), 29doing so is considered bad form. 30.Pp 31The zFormat string must not be NULL. 32.Pp 33To avoid deadlocks and other threading problems, the sqlite3_log() 34routine will not use dynamically allocated memory. 35The log message is stored in a fixed-length buffer on the stack. 36If the log message is longer than a few hundred characters, it will 37be truncated to the length of the buffer. 38.Sh IMPLEMENTATION NOTES 39These declarations were extracted from the 40interface documentation at line 9489. 41.Bd -literal 42SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); 43.Ed 44.Sh SEE ALSO 45.Xr sqlite3_config 3 , 46.Xr sqlite3_mprintf 3 , 47.Xr SQLITE_CONFIG_SINGLETHREAD 3 48