Add alarmchecker

This commit is contained in:
sparklet 2022-10-30 16:15:08 +08:00
parent 8de0f268bd
commit 8e3c2df365
1 changed files with 26 additions and 0 deletions

26
alarmchecker Normal file
View File

@ -0,0 +1,26 @@
/* implementation of alarm module. */
void AlarmFree(void* pointer)
{
if (pointer != NULL)
pfree(pointer);
}
+/* Alert assignment */
void* AlarmAlloc(size_t size)
{
return palloc(size);
}
+/* Implement alarm logs */
void AlarmLogImplementation(int level, const char* prefix, const char* logtext)
{
switch (level) {
case ALM_DEBUG:
ereport(DEBUG3, (errmsg("%s%s", prefix, logtext)));
break;
case ALM_LOG:
ereport(LOG, (errmsg("%s%s", prefix, logtext)));
break;
default:
break;
}
}