/* logger.c generated by valac 0.56.19, the Vala compiler
 * generated from logger.vala, do not modify */

/*
 * Copyright (c) 2024-2025 focus-timer contributors
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

#include "ft_core.h"
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <glib-object.h>
#include <gio/gio.h>

#define FT_LOGGER_MAX_ENTRIES ((guint) 200)
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	FT_LOG_ENTRY_0_PROPERTY,
	FT_LOG_ENTRY_ID_PROPERTY,
	FT_LOG_ENTRY_TIMESTAMP_PROPERTY,
	FT_LOG_ENTRY_LABEL_PROPERTY,
	FT_LOG_ENTRY_CONTEXT_PROPERTY,
	FT_LOG_ENTRY_NUM_PROPERTIES
};
static GParamSpec* ft_log_entry_properties[FT_LOG_ENTRY_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _ft_context_unref0(var) ((var == NULL) ? NULL : (var = (ft_context_unref (var), NULL)))
typedef struct _FtEventLogEntry FtEventLogEntry;
typedef struct _FtEventLogEntryClass FtEventLogEntryClass;
typedef struct _FtEventLogEntryPrivate FtEventLogEntryPrivate;
enum  {
	FT_EVENT_LOG_ENTRY_0_PROPERTY,
	FT_EVENT_LOG_ENTRY_EVENT_NAME_PROPERTY,
	FT_EVENT_LOG_ENTRY_NUM_PROPERTIES
};
static GParamSpec* ft_event_log_entry_properties[FT_EVENT_LOG_ENTRY_NUM_PROPERTIES];
enum  {
	FT_ACTION_LOG_ENTRY_0_PROPERTY,
	FT_ACTION_LOG_ENTRY_ACTION_UUID_PROPERTY,
	FT_ACTION_LOG_ENTRY_EVENT_NAME_PROPERTY,
	FT_ACTION_LOG_ENTRY_COMMAND_LINE_PROPERTY,
	FT_ACTION_LOG_ENTRY_COMMAND_OUTPUT_PROPERTY,
	FT_ACTION_LOG_ENTRY_COMMAND_ERROR_MESSAGE_PROPERTY,
	FT_ACTION_LOG_ENTRY_COMMAND_EXIT_CODE_PROPERTY,
	FT_ACTION_LOG_ENTRY_COMMAND_EXECUTION_TIME_PROPERTY,
	FT_ACTION_LOG_ENTRY_NUM_PROPERTIES
};
static GParamSpec* ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_NUM_PROPERTIES];
enum  {
	FT_LOGGER_0_PROPERTY,
	FT_LOGGER_MODEL_PROPERTY,
	FT_LOGGER_NUM_PROPERTIES
};
static GParamSpec* ft_logger_properties[FT_LOGGER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _Block23Data Block23Data;

struct _FtLogEntryPrivate {
	gint64 _timestamp;
	gchar* _label;
	FtContext* _context;
	gulong _id;
};

struct _FtEventLogEntry {
	FtLogEntry parent_instance;
	FtEventLogEntryPrivate * priv;
};

struct _FtEventLogEntryClass {
	FtLogEntryClass parent_class;
};

struct _FtEventLogEntryPrivate {
	gchar* _event_name;
};

struct _FtActionLogEntryPrivate {
	gchar* _command_error_message;
	gint _command_exit_code;
	gint64 _command_execution_time;
	gchar* _action_uuid;
	gchar* _event_name;
	gchar* _command_line;
	gchar* _command_output;
};

struct _FtLoggerPrivate {
	GListStore* _model;
};

struct _Block23Data {
	int _ref_count_;
	FtLogger* self;
	FtActionLogEntry* entry;
};

static gint FtLogEntry_private_offset;
static gpointer ft_log_entry_parent_class = NULL;
static gulong ft_log_entry_next_id;
static gulong ft_log_entry_next_id = (gulong) 1;
static gint FtEventLogEntry_private_offset;
static gpointer ft_event_log_entry_parent_class = NULL;
static gint FtActionLogEntry_private_offset;
static gpointer ft_action_log_entry_parent_class = NULL;
static gint FtLogger_private_offset;
static gpointer ft_logger_parent_class = NULL;

static void ft_log_entry_finalize (GObject * obj);
static GType ft_log_entry_get_type_once (void);
static void _vala_ft_log_entry_get_property (GObject * object,
                                      guint property_id,
                                      GValue * value,
                                      GParamSpec * pspec);
static void _vala_ft_log_entry_set_property (GObject * object,
                                      guint property_id,
                                      const GValue * value,
                                      GParamSpec * pspec);
static void ft_event_log_entry_finalize (GObject * obj);
static GType ft_event_log_entry_get_type_once (void);
static void _vala_ft_event_log_entry_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_ft_event_log_entry_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
static void ft_action_log_entry_finalize (GObject * obj);
static GType ft_action_log_entry_get_type_once (void);
static void _vala_ft_action_log_entry_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_ft_action_log_entry_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);
static gboolean ft_logger_transform_to_error_message (FtLogger* self,
                                               GBinding* binding,
                                               GValue* source_value,
                                               GValue* target_value);
static inline gulong ft_logger_log (FtLogger* self,
                      FtLogEntry* entry);
static gulong ft_logger_log_action_event (FtLogger* self,
                                   FtAction* action,
                                   const gchar* event_name,
                                   FtContext* context,
                                   FtCommandExecution* execution);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static gboolean _ft_logger_transform_to_error_message_gbinding_transform_func (GBinding* binding,
                                                                        GValue* from_value,
                                                                        GValue* to_value,
                                                                        gpointer self);
static void ____lambda74_ (Block23Data* _data23_);
static void _____lambda74__g_object_notify (GObject* _sender,
                                     GParamSpec* pspec,
                                     gpointer self);
static void ft_logger_real_dispose (GObject* base);
static GObject * ft_logger_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties);
static void ft_logger_finalize (GObject * obj);
static GType ft_logger_get_type_once (void);
static void _vala_ft_logger_get_property (GObject * object,
                                   guint property_id,
                                   GValue * value,
                                   GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
ft_log_entry_get_instance_private (FtLogEntry* self)
{
	return G_STRUCT_MEMBER_P (self, FtLogEntry_private_offset);
}

FtLogEntry*
ft_log_entry_construct (GType object_type)
{
	FtLogEntry * self = NULL;
	self = (FtLogEntry*) g_object_new (object_type, NULL);
	return self;
}

gulong
ft_log_entry_get_id (FtLogEntry* self)
{
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	result = self->priv->_id;
	return result;
}

static void
ft_log_entry_set_id (FtLogEntry* self,
                     gulong value)
{
	gulong _tmp0_;
	g_return_if_fail (self != NULL);
	self->priv->_id = ft_log_entry_next_id;
	_tmp0_ = ft_log_entry_next_id;
	ft_log_entry_next_id = _tmp0_ + 1;
	g_object_notify_by_pspec ((GObject *) self, ft_log_entry_properties[FT_LOG_ENTRY_ID_PROPERTY]);
}

gint64
ft_log_entry_get_timestamp (FtLogEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_timestamp;
	return result;
}

void
ft_log_entry_set_timestamp (FtLogEntry* self,
                            gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_log_entry_get_timestamp (self);
	if (old_value != value) {
		self->priv->_timestamp = value;
		g_object_notify_by_pspec ((GObject *) self, ft_log_entry_properties[FT_LOG_ENTRY_TIMESTAMP_PROPERTY]);
	}
}

const gchar*
ft_log_entry_get_label (FtLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_label;
	result = _tmp0_;
	return result;
}

void
ft_log_entry_set_label (FtLogEntry* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_log_entry_get_label (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_label);
		self->priv->_label = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_log_entry_properties[FT_LOG_ENTRY_LABEL_PROPERTY]);
	}
}

FtContext*
ft_log_entry_get_context (FtLogEntry* self)
{
	FtContext* result;
	FtContext* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_context;
	result = _tmp0_;
	return result;
}

static gpointer
_ft_context_ref0 (gpointer self)
{
	return self ? ft_context_ref (self) : NULL;
}

void
ft_log_entry_set_context (FtLogEntry* self,
                          FtContext* value)
{
	FtContext* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_log_entry_get_context (self);
	if (old_value != value) {
		FtContext* _tmp0_;
		_tmp0_ = _ft_context_ref0 (value);
		_ft_context_unref0 (self->priv->_context);
		self->priv->_context = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_log_entry_properties[FT_LOG_ENTRY_CONTEXT_PROPERTY]);
	}
}

static void
ft_log_entry_class_init (FtLogEntryClass * klass,
                         gpointer klass_data)
{
	ft_log_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtLogEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_log_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_log_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_log_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_LOG_ENTRY_ID_PROPERTY, ft_log_entry_properties[FT_LOG_ENTRY_ID_PROPERTY] = g_param_spec_ulong ("id", "id", "id", 0, G_MAXULONG, 0UL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_LOG_ENTRY_TIMESTAMP_PROPERTY, ft_log_entry_properties[FT_LOG_ENTRY_TIMESTAMP_PROPERTY] = g_param_spec_int64 ("timestamp", "timestamp", "timestamp", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_LOG_ENTRY_LABEL_PROPERTY, ft_log_entry_properties[FT_LOG_ENTRY_LABEL_PROPERTY] = g_param_spec_string ("label", "label", "label", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_LOG_ENTRY_CONTEXT_PROPERTY, ft_log_entry_properties[FT_LOG_ENTRY_CONTEXT_PROPERTY] = ft_param_spec_context ("context", "context", "context", FT_TYPE_CONTEXT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
ft_log_entry_instance_init (FtLogEntry * self,
                            gpointer klass)
{
	self->priv = ft_log_entry_get_instance_private (self);
}

static void
ft_log_entry_finalize (GObject * obj)
{
	FtLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_LOG_ENTRY, FtLogEntry);
	_g_free0 (self->priv->_label);
	_ft_context_unref0 (self->priv->_context);
	G_OBJECT_CLASS (ft_log_entry_parent_class)->finalize (obj);
}

static GType
ft_log_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtLogEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_log_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtLogEntry), 0, (GInstanceInitFunc) ft_log_entry_instance_init, NULL };
	GType ft_log_entry_type_id;
	ft_log_entry_type_id = g_type_register_static (G_TYPE_OBJECT, "FtLogEntry", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	FtLogEntry_private_offset = g_type_add_instance_private (ft_log_entry_type_id, sizeof (FtLogEntryPrivate));
	return ft_log_entry_type_id;
}

GType
ft_log_entry_get_type (void)
{
	static volatile gsize ft_log_entry_type_id__once = 0;
	if (g_once_init_enter (&ft_log_entry_type_id__once)) {
		GType ft_log_entry_type_id;
		ft_log_entry_type_id = ft_log_entry_get_type_once ();
		g_once_init_leave (&ft_log_entry_type_id__once, ft_log_entry_type_id);
	}
	return ft_log_entry_type_id__once;
}

static void
_vala_ft_log_entry_get_property (GObject * object,
                                 guint property_id,
                                 GValue * value,
                                 GParamSpec * pspec)
{
	FtLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_LOG_ENTRY, FtLogEntry);
	switch (property_id) {
		case FT_LOG_ENTRY_ID_PROPERTY:
		g_value_set_ulong (value, ft_log_entry_get_id (self));
		break;
		case FT_LOG_ENTRY_TIMESTAMP_PROPERTY:
		g_value_set_int64 (value, ft_log_entry_get_timestamp (self));
		break;
		case FT_LOG_ENTRY_LABEL_PROPERTY:
		g_value_set_string (value, ft_log_entry_get_label (self));
		break;
		case FT_LOG_ENTRY_CONTEXT_PROPERTY:
		ft_value_set_context (value, ft_log_entry_get_context (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_log_entry_set_property (GObject * object,
                                 guint property_id,
                                 const GValue * value,
                                 GParamSpec * pspec)
{
	FtLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_LOG_ENTRY, FtLogEntry);
	switch (property_id) {
		case FT_LOG_ENTRY_ID_PROPERTY:
		ft_log_entry_set_id (self, g_value_get_ulong (value));
		break;
		case FT_LOG_ENTRY_TIMESTAMP_PROPERTY:
		ft_log_entry_set_timestamp (self, g_value_get_int64 (value));
		break;
		case FT_LOG_ENTRY_LABEL_PROPERTY:
		ft_log_entry_set_label (self, g_value_get_string (value));
		break;
		case FT_LOG_ENTRY_CONTEXT_PROPERTY:
		ft_log_entry_set_context (self, ft_value_get_context (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
ft_event_log_entry_get_instance_private (FtEventLogEntry* self)
{
	return G_STRUCT_MEMBER_P (self, FtEventLogEntry_private_offset);
}

FtEventLogEntry*
ft_event_log_entry_construct (GType object_type,
                              FtEvent* event)
{
	FtEventLogEntry * self = NULL;
	FtContext* _tmp0_;
	FtEventSpec* _tmp1_;
	const gchar* _tmp2_;
	FtContext* _tmp3_;
	FtEventSpec* _tmp4_;
	const gchar* _tmp5_;
	g_return_val_if_fail (event != NULL, NULL);
	_tmp0_ = event->context;
	_tmp1_ = event->spec;
	_tmp2_ = _tmp1_->display_name;
	_tmp3_ = event->context;
	_tmp4_ = event->spec;
	_tmp5_ = _tmp4_->name;
	self = (FtEventLogEntry*) g_object_new (object_type, "timestamp", _tmp0_->timestamp, "label", _tmp2_, "context", _tmp3_, "event-name", _tmp5_, NULL);
	return self;
}

FtEventLogEntry*
ft_event_log_entry_new (FtEvent* event)
{
	return ft_event_log_entry_construct (FT_TYPE_EVENT_LOG_ENTRY, event);
}

const gchar*
ft_event_log_entry_get_event_name (FtEventLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_event_name;
	result = _tmp0_;
	return result;
}

void
ft_event_log_entry_set_event_name (FtEventLogEntry* self,
                                   const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_event_name);
	self->priv->_event_name = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_event_log_entry_properties[FT_EVENT_LOG_ENTRY_EVENT_NAME_PROPERTY]);
}

static void
ft_event_log_entry_class_init (FtEventLogEntryClass * klass,
                               gpointer klass_data)
{
	ft_event_log_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtEventLogEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_event_log_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_event_log_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_event_log_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_EVENT_LOG_ENTRY_EVENT_NAME_PROPERTY, ft_event_log_entry_properties[FT_EVENT_LOG_ENTRY_EVENT_NAME_PROPERTY] = g_param_spec_string ("event-name", "event-name", "event-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
ft_event_log_entry_instance_init (FtEventLogEntry * self,
                                  gpointer klass)
{
	self->priv = ft_event_log_entry_get_instance_private (self);
}

static void
ft_event_log_entry_finalize (GObject * obj)
{
	FtEventLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_EVENT_LOG_ENTRY, FtEventLogEntry);
	_g_free0 (self->priv->_event_name);
	G_OBJECT_CLASS (ft_event_log_entry_parent_class)->finalize (obj);
}

static GType
ft_event_log_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtEventLogEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_event_log_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtEventLogEntry), 0, (GInstanceInitFunc) ft_event_log_entry_instance_init, NULL };
	GType ft_event_log_entry_type_id;
	ft_event_log_entry_type_id = g_type_register_static (FT_TYPE_LOG_ENTRY, "FtEventLogEntry", &g_define_type_info, 0);
	FtEventLogEntry_private_offset = g_type_add_instance_private (ft_event_log_entry_type_id, sizeof (FtEventLogEntryPrivate));
	return ft_event_log_entry_type_id;
}

GType
ft_event_log_entry_get_type (void)
{
	static volatile gsize ft_event_log_entry_type_id__once = 0;
	if (g_once_init_enter (&ft_event_log_entry_type_id__once)) {
		GType ft_event_log_entry_type_id;
		ft_event_log_entry_type_id = ft_event_log_entry_get_type_once ();
		g_once_init_leave (&ft_event_log_entry_type_id__once, ft_event_log_entry_type_id);
	}
	return ft_event_log_entry_type_id__once;
}

static void
_vala_ft_event_log_entry_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	FtEventLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_EVENT_LOG_ENTRY, FtEventLogEntry);
	switch (property_id) {
		case FT_EVENT_LOG_ENTRY_EVENT_NAME_PROPERTY:
		g_value_set_string (value, ft_event_log_entry_get_event_name (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_event_log_entry_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	FtEventLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_EVENT_LOG_ENTRY, FtEventLogEntry);
	switch (property_id) {
		case FT_EVENT_LOG_ENTRY_EVENT_NAME_PROPERTY:
		ft_event_log_entry_set_event_name (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
ft_action_log_entry_get_instance_private (FtActionLogEntry* self)
{
	return G_STRUCT_MEMBER_P (self, FtActionLogEntry_private_offset);
}

FtActionLogEntry*
ft_action_log_entry_construct (GType object_type,
                               FtAction* action,
                               const gchar* event_name,
                               FtContext* context,
                               FtCommandExecution* execution)
{
	FtActionLogEntry * self = NULL;
	gchar* _tmp0_ = NULL;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	g_return_val_if_fail (action != NULL, NULL);
	g_return_val_if_fail (event_name != NULL, NULL);
	g_return_val_if_fail (context != NULL, NULL);
	if (execution != NULL) {
		gchar* _tmp1_;
		_tmp1_ = ft_command_execution_get_line (execution);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp1_;
	} else {
		gchar* _tmp2_;
		_tmp2_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	}
	_tmp3_ = ft_action_get_display_name (action);
	_tmp4_ = _tmp3_;
	_tmp5_ = ft_action_get_uuid (action);
	_tmp6_ = _tmp5_;
	self = (FtActionLogEntry*) g_object_new (object_type, "timestamp", context->timestamp, "label", _tmp4_, "event-name", event_name, "context", context, "action-uuid", _tmp6_, "command-line", _tmp0_, "command-error-message", NULL, "command-exit-code", -1, "command-execution-time", 0, NULL);
	_g_free0 (_tmp0_);
	return self;
}

FtActionLogEntry*
ft_action_log_entry_new (FtAction* action,
                         const gchar* event_name,
                         FtContext* context,
                         FtCommandExecution* execution)
{
	return ft_action_log_entry_construct (FT_TYPE_ACTION_LOG_ENTRY, action, event_name, context, execution);
}

const gchar*
ft_action_log_entry_get_action_uuid (FtActionLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_action_uuid;
	result = _tmp0_;
	return result;
}

void
ft_action_log_entry_set_action_uuid (FtActionLogEntry* self,
                                     const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_action_uuid);
	self->priv->_action_uuid = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_ACTION_UUID_PROPERTY]);
}

const gchar*
ft_action_log_entry_get_event_name (FtActionLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_event_name;
	result = _tmp0_;
	return result;
}

void
ft_action_log_entry_set_event_name (FtActionLogEntry* self,
                                    const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_event_name);
	self->priv->_event_name = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_EVENT_NAME_PROPERTY]);
}

const gchar*
ft_action_log_entry_get_command_line (FtActionLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_command_line;
	result = _tmp0_;
	return result;
}

void
ft_action_log_entry_set_command_line (FtActionLogEntry* self,
                                      const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_command_line);
	self->priv->_command_line = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_LINE_PROPERTY]);
}

const gchar*
ft_action_log_entry_get_command_output (FtActionLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_command_output;
	result = _tmp0_;
	return result;
}

void
ft_action_log_entry_set_command_output (FtActionLogEntry* self,
                                        const gchar* value)
{
	gchar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_strdup (value);
	_g_free0 (self->priv->_command_output);
	self->priv->_command_output = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_OUTPUT_PROPERTY]);
}

const gchar*
ft_action_log_entry_get_command_error_message (FtActionLogEntry* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_command_error_message;
	result = _tmp0_;
	return result;
}

void
ft_action_log_entry_set_command_error_message (FtActionLogEntry* self,
                                               const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_action_log_entry_get_command_error_message (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_command_error_message);
		self->priv->_command_error_message = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_ERROR_MESSAGE_PROPERTY]);
	}
}

gint
ft_action_log_entry_get_command_exit_code (FtActionLogEntry* self)
{
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	result = self->priv->_command_exit_code;
	return result;
}

void
ft_action_log_entry_set_command_exit_code (FtActionLogEntry* self,
                                           gint value)
{
	gint old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_action_log_entry_get_command_exit_code (self);
	if (old_value != value) {
		self->priv->_command_exit_code = value;
		g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_EXIT_CODE_PROPERTY]);
	}
}

gint64
ft_action_log_entry_get_command_execution_time (FtActionLogEntry* self)
{
	gint64 result;
	g_return_val_if_fail (self != NULL, -1LL);
	result = self->priv->_command_execution_time;
	return result;
}

void
ft_action_log_entry_set_command_execution_time (FtActionLogEntry* self,
                                                gint64 value)
{
	gint64 old_value;
	g_return_if_fail (self != NULL);
	old_value = ft_action_log_entry_get_command_execution_time (self);
	if (old_value != value) {
		self->priv->_command_execution_time = value;
		g_object_notify_by_pspec ((GObject *) self, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_EXECUTION_TIME_PROPERTY]);
	}
}

static void
ft_action_log_entry_class_init (FtActionLogEntryClass * klass,
                                gpointer klass_data)
{
	ft_action_log_entry_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtActionLogEntry_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_action_log_entry_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_ft_action_log_entry_set_property;
	G_OBJECT_CLASS (klass)->finalize = ft_action_log_entry_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_ACTION_UUID_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_ACTION_UUID_PROPERTY] = g_param_spec_string ("action-uuid", "action-uuid", "action-uuid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_EVENT_NAME_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_EVENT_NAME_PROPERTY] = g_param_spec_string ("event-name", "event-name", "event-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_COMMAND_LINE_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_LINE_PROPERTY] = g_param_spec_string ("command-line", "command-line", "command-line", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_COMMAND_OUTPUT_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_OUTPUT_PROPERTY] = g_param_spec_string ("command-output", "command-output", "command-output", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_COMMAND_ERROR_MESSAGE_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_ERROR_MESSAGE_PROPERTY] = g_param_spec_string ("command-error-message", "command-error-message", "command-error-message", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_COMMAND_EXIT_CODE_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_EXIT_CODE_PROPERTY] = g_param_spec_int ("command-exit-code", "command-exit-code", "command-exit-code", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_ACTION_LOG_ENTRY_COMMAND_EXECUTION_TIME_PROPERTY, ft_action_log_entry_properties[FT_ACTION_LOG_ENTRY_COMMAND_EXECUTION_TIME_PROPERTY] = g_param_spec_int64 ("command-execution-time", "command-execution-time", "command-execution-time", G_MININT64, G_MAXINT64, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
ft_action_log_entry_instance_init (FtActionLogEntry * self,
                                   gpointer klass)
{
	self->priv = ft_action_log_entry_get_instance_private (self);
}

static void
ft_action_log_entry_finalize (GObject * obj)
{
	FtActionLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_ACTION_LOG_ENTRY, FtActionLogEntry);
	_g_free0 (self->priv->_command_error_message);
	_g_free0 (self->priv->_action_uuid);
	_g_free0 (self->priv->_event_name);
	_g_free0 (self->priv->_command_line);
	_g_free0 (self->priv->_command_output);
	G_OBJECT_CLASS (ft_action_log_entry_parent_class)->finalize (obj);
}

static GType
ft_action_log_entry_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtActionLogEntryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_action_log_entry_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtActionLogEntry), 0, (GInstanceInitFunc) ft_action_log_entry_instance_init, NULL };
	GType ft_action_log_entry_type_id;
	ft_action_log_entry_type_id = g_type_register_static (FT_TYPE_LOG_ENTRY, "FtActionLogEntry", &g_define_type_info, 0);
	FtActionLogEntry_private_offset = g_type_add_instance_private (ft_action_log_entry_type_id, sizeof (FtActionLogEntryPrivate));
	return ft_action_log_entry_type_id;
}

GType
ft_action_log_entry_get_type (void)
{
	static volatile gsize ft_action_log_entry_type_id__once = 0;
	if (g_once_init_enter (&ft_action_log_entry_type_id__once)) {
		GType ft_action_log_entry_type_id;
		ft_action_log_entry_type_id = ft_action_log_entry_get_type_once ();
		g_once_init_leave (&ft_action_log_entry_type_id__once, ft_action_log_entry_type_id);
	}
	return ft_action_log_entry_type_id__once;
}

static void
_vala_ft_action_log_entry_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	FtActionLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_ACTION_LOG_ENTRY, FtActionLogEntry);
	switch (property_id) {
		case FT_ACTION_LOG_ENTRY_ACTION_UUID_PROPERTY:
		g_value_set_string (value, ft_action_log_entry_get_action_uuid (self));
		break;
		case FT_ACTION_LOG_ENTRY_EVENT_NAME_PROPERTY:
		g_value_set_string (value, ft_action_log_entry_get_event_name (self));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_LINE_PROPERTY:
		g_value_set_string (value, ft_action_log_entry_get_command_line (self));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_OUTPUT_PROPERTY:
		g_value_set_string (value, ft_action_log_entry_get_command_output (self));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_ERROR_MESSAGE_PROPERTY:
		g_value_set_string (value, ft_action_log_entry_get_command_error_message (self));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_EXIT_CODE_PROPERTY:
		g_value_set_int (value, ft_action_log_entry_get_command_exit_code (self));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_EXECUTION_TIME_PROPERTY:
		g_value_set_int64 (value, ft_action_log_entry_get_command_execution_time (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_ft_action_log_entry_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	FtActionLogEntry * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_ACTION_LOG_ENTRY, FtActionLogEntry);
	switch (property_id) {
		case FT_ACTION_LOG_ENTRY_ACTION_UUID_PROPERTY:
		ft_action_log_entry_set_action_uuid (self, g_value_get_string (value));
		break;
		case FT_ACTION_LOG_ENTRY_EVENT_NAME_PROPERTY:
		ft_action_log_entry_set_event_name (self, g_value_get_string (value));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_LINE_PROPERTY:
		ft_action_log_entry_set_command_line (self, g_value_get_string (value));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_OUTPUT_PROPERTY:
		ft_action_log_entry_set_command_output (self, g_value_get_string (value));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_ERROR_MESSAGE_PROPERTY:
		ft_action_log_entry_set_command_error_message (self, g_value_get_string (value));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_EXIT_CODE_PROPERTY:
		ft_action_log_entry_set_command_exit_code (self, g_value_get_int (value));
		break;
		case FT_ACTION_LOG_ENTRY_COMMAND_EXECUTION_TIME_PROPERTY:
		ft_action_log_entry_set_command_execution_time (self, g_value_get_int64 (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
ft_logger_get_instance_private (FtLogger* self)
{
	return G_STRUCT_MEMBER_P (self, FtLogger_private_offset);
}

static gpointer
_g_error_copy0 (gpointer self)
{
	return self ? g_error_copy (self) : NULL;
}

static gboolean
ft_logger_transform_to_error_message (FtLogger* self,
                                      GBinding* binding,
                                      GValue* source_value,
                                      GValue* target_value)
{
	GError* _error_ = NULL;
	void* _tmp0_;
	GError* _tmp1_;
	const gchar* _tmp2_ = NULL;
	GError* _tmp3_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (source_value != NULL, FALSE);
	g_return_val_if_fail (target_value != NULL, FALSE);
	_tmp0_ = g_value_get_boxed (source_value);
	_tmp1_ = _g_error_copy0 ((GError*) _tmp0_);
	_error_ = _tmp1_;
	_tmp3_ = _error_;
	if (_tmp3_ != NULL) {
		GError* _tmp4_;
		const gchar* _tmp5_;
		_tmp4_ = _error_;
		_tmp5_ = _tmp4_->message;
		_tmp2_ = _tmp5_;
	} else {
		_tmp2_ = NULL;
	}
	g_value_set_string (target_value, _tmp2_);
	result = TRUE;
	_g_error_free0 (_error_);
	return result;
}

static inline gulong
ft_logger_log (FtLogger* self,
               FtLogEntry* entry)
{
	GListStore* _tmp0_;
	gulong _tmp5_;
	gulong _tmp6_;
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	g_return_val_if_fail (entry != NULL, 0UL);
	_tmp0_ = self->priv->_model;
	g_list_store_append (_tmp0_, (GObject*) entry);
	while (TRUE) {
		GListStore* _tmp1_;
		guint _tmp2_;
		guint _tmp3_;
		GListStore* _tmp4_;
		_tmp1_ = self->priv->_model;
		g_object_get (_tmp1_, "n-items", &_tmp2_, NULL);
		_tmp3_ = _tmp2_;
		if (!(_tmp3_ > FT_LOGGER_MAX_ENTRIES)) {
			break;
		}
		_tmp4_ = self->priv->_model;
		g_list_store_remove (_tmp4_, (guint) 0);
	}
	_tmp5_ = ft_log_entry_get_id (entry);
	_tmp6_ = _tmp5_;
	result = _tmp6_;
	return result;
}

gulong
ft_logger_log_event (FtLogger* self,
                     FtEvent* event)
{
	FtEventLogEntry* _tmp0_;
	FtEventLogEntry* _tmp1_;
	gulong _tmp2_;
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	g_return_val_if_fail (event != NULL, 0UL);
	_tmp0_ = ft_event_log_entry_new (event);
	_tmp1_ = _tmp0_;
	_tmp2_ = ft_logger_log (self, (FtLogEntry*) _tmp1_);
	_g_object_unref0 (_tmp1_);
	result = _tmp2_;
	return result;
}

static Block23Data*
block23_data_ref (Block23Data* _data23_)
{
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}

static void
block23_data_unref (void * _userdata_)
{
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		FtLogger* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->entry);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}

static gboolean
_ft_logger_transform_to_error_message_gbinding_transform_func (GBinding* binding,
                                                               GValue* from_value,
                                                               GValue* to_value,
                                                               gpointer self)
{
	gboolean result;
	result = ft_logger_transform_to_error_message ((FtLogger*) self, binding, from_value, to_value);
	return result;
}

static void
____lambda74_ (Block23Data* _data23_)
{
	FtLogger* self;
	FtActionLogEntry* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	self = _data23_->self;
	_tmp0_ = _data23_->entry;
	_tmp1_ = ft_action_log_entry_get_command_exit_code (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ < 0) {
		FtActionLogEntry* _tmp3_;
		_tmp3_ = _data23_->entry;
		g_object_notify ((GObject*) _tmp3_, "command-exit-code");
	}
}

static void
_____lambda74__g_object_notify (GObject* _sender,
                                GParamSpec* pspec,
                                gpointer self)
{
	____lambda74_ (self);
}

static gulong
ft_logger_log_action_event (FtLogger* self,
                            FtAction* action,
                            const gchar* event_name,
                            FtContext* context,
                            FtCommandExecution* execution)
{
	Block23Data* _data23_;
	FtActionLogEntry* _tmp0_;
	FtActionLogEntry* _tmp7_;
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	g_return_val_if_fail (action != NULL, 0UL);
	g_return_val_if_fail (event_name != NULL, 0UL);
	g_return_val_if_fail (context != NULL, 0UL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = ft_action_log_entry_new (action, event_name, context, execution);
	_data23_->entry = _tmp0_;
	if (execution != NULL) {
		FtActionLogEntry* _tmp1_;
		FtActionLogEntry* _tmp2_;
		FtActionLogEntry* _tmp3_;
		FtActionLogEntry* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp1_ = _data23_->entry;
		g_object_bind_property_with_closures ((GObject*) execution, "output", (GObject*) _tmp1_, "command-output", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp2_ = _data23_->entry;
		g_object_bind_property_with_closures ((GObject*) execution, "exit-code", (GObject*) _tmp2_, "command-exit-code", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp3_ = _data23_->entry;
		g_object_bind_property_with_closures ((GObject*) execution, "execution-time", (GObject*) _tmp3_, "command-execution-time", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp4_ = _data23_->entry;
		g_object_bind_property_with_closures ((GObject*) execution, "error", (GObject*) _tmp4_, "command-error-message", G_BINDING_SYNC_CREATE, (GClosure*) ((_ft_logger_transform_to_error_message_gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) _ft_logger_transform_to_error_message_gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp5_ = ft_job_get_completed ((FtJob*) execution);
		_tmp6_ = _tmp5_;
		if (!_tmp6_) {
			g_signal_connect_data ((GObject*) execution, "notify::completed", (GCallback) _____lambda74__g_object_notify, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
		}
	}
	_tmp7_ = _data23_->entry;
	result = ft_logger_log (self, (FtLogEntry*) _tmp7_);
	block23_data_unref (_data23_);
	_data23_ = NULL;
	return result;
}

gulong
ft_logger_log_action_triggered (FtLogger* self,
                                FtEventAction* action,
                                FtContext* context,
                                FtCommandExecution* execution)
{
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	g_return_val_if_fail (action != NULL, 0UL);
	g_return_val_if_fail (context != NULL, 0UL);
	result = ft_logger_log_action_event (self, (FtAction*) action, "triggered", context, execution);
	return result;
}

gulong
ft_logger_log_action_entered_condition (FtLogger* self,
                                        FtConditionAction* action,
                                        FtContext* context,
                                        FtCommandExecution* execution)
{
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	g_return_val_if_fail (action != NULL, 0UL);
	g_return_val_if_fail (context != NULL, 0UL);
	result = ft_logger_log_action_event (self, (FtAction*) action, "entered-condition", context, execution);
	return result;
}

gulong
ft_logger_log_action_exited_condition (FtLogger* self,
                                       FtConditionAction* action,
                                       FtContext* context,
                                       FtCommandExecution* execution)
{
	gulong result;
	g_return_val_if_fail (self != NULL, 0UL);
	g_return_val_if_fail (action != NULL, 0UL);
	g_return_val_if_fail (context != NULL, 0UL);
	result = ft_logger_log_action_event (self, (FtAction*) action, "exited-condition", context, execution);
	return result;
}

static void
ft_logger_real_dispose (GObject* base)
{
	FtLogger * self;
	self = (FtLogger*) base;
	_g_object_unref0 (self->priv->_model);
	self->priv->_model = NULL;
	G_OBJECT_CLASS (ft_logger_parent_class)->dispose (G_TYPE_CHECK_INSTANCE_CAST (self, G_TYPE_OBJECT, GObject));
}

FtLogger*
ft_logger_construct (GType object_type)
{
	FtLogger * self = NULL;
	self = (FtLogger*) g_object_new (object_type, NULL);
	return self;
}

FtLogger*
ft_logger_new (void)
{
	return ft_logger_construct (FT_TYPE_LOGGER);
}

GListModel*
ft_logger_get_model (FtLogger* self)
{
	GListModel* result;
	GListStore* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_model;
	result = (GListModel*) _tmp0_;
	return result;
}

static GObject *
ft_logger_constructor (GType type,
                       guint n_construct_properties,
                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	static GWeakRef FtLogger_singleton__ref;
	static GMutex FtLogger_singleton__lock;
	FtLogger * self;
	GListStore* _tmp0_;
	g_mutex_lock (&FtLogger_singleton__lock);
	obj = g_weak_ref_get (&FtLogger_singleton__ref);
	if (obj != NULL) {
		g_mutex_unlock (&FtLogger_singleton__lock);
		return obj;
	}
	parent_class = G_OBJECT_CLASS (ft_logger_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_LOGGER, FtLogger);
	_tmp0_ = g_list_store_new (FT_TYPE_LOG_ENTRY);
	_g_object_unref0 (self->priv->_model);
	self->priv->_model = _tmp0_;
	g_weak_ref_set (&FtLogger_singleton__ref, obj);
	g_mutex_unlock (&FtLogger_singleton__lock);
	return obj;
}

static void
ft_logger_class_init (FtLoggerClass * klass,
                      gpointer klass_data)
{
	ft_logger_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &FtLogger_private_offset);
	((GObjectClass *) klass)->dispose = (void (*) (GObject*)) ft_logger_real_dispose;
	G_OBJECT_CLASS (klass)->get_property = _vala_ft_logger_get_property;
	G_OBJECT_CLASS (klass)->constructor = ft_logger_constructor;
	G_OBJECT_CLASS (klass)->finalize = ft_logger_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), FT_LOGGER_MODEL_PROPERTY, ft_logger_properties[FT_LOGGER_MODEL_PROPERTY] = g_param_spec_object ("model", "model", "model", g_list_model_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
ft_logger_instance_init (FtLogger * self,
                         gpointer klass)
{
	self->priv = ft_logger_get_instance_private (self);
	self->priv->_model = NULL;
}

static void
ft_logger_finalize (GObject * obj)
{
	FtLogger * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, FT_TYPE_LOGGER, FtLogger);
	_g_object_unref0 (self->priv->_model);
	G_OBJECT_CLASS (ft_logger_parent_class)->finalize (obj);
}

static GType
ft_logger_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (FtLoggerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) ft_logger_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FtLogger), 0, (GInstanceInitFunc) ft_logger_instance_init, NULL };
	GType ft_logger_type_id;
	ft_logger_type_id = g_type_register_static (G_TYPE_OBJECT, "FtLogger", &g_define_type_info, 0);
	FtLogger_private_offset = g_type_add_instance_private (ft_logger_type_id, sizeof (FtLoggerPrivate));
	return ft_logger_type_id;
}

GType
ft_logger_get_type (void)
{
	static volatile gsize ft_logger_type_id__once = 0;
	if (g_once_init_enter (&ft_logger_type_id__once)) {
		GType ft_logger_type_id;
		ft_logger_type_id = ft_logger_get_type_once ();
		g_once_init_leave (&ft_logger_type_id__once, ft_logger_type_id);
	}
	return ft_logger_type_id__once;
}

static void
_vala_ft_logger_get_property (GObject * object,
                              guint property_id,
                              GValue * value,
                              GParamSpec * pspec)
{
	FtLogger * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, FT_TYPE_LOGGER, FtLogger);
	switch (property_id) {
		case FT_LOGGER_MODEL_PROPERTY:
		g_value_set_object (value, ft_logger_get_model (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

