Without knowing what you are trying to accomplish, the easiest way to add something to your log is to use the mycred_get_settings function.
Example:
// Init myCRED
$mycred = mycred_get_settings();
// Add a custom log entry
$mycred->add_to_log(
'my_custom_reference', // reference ID. Should be explanatory (required)
1, // user id (required)
10, // points amount (required)
'My log entry text', // log entry (optional)
1, // reference id. Only integers are allowed, used to store user / post / comment ids
'optional extra', // optional extra data space
'mycred_default' // points type, will default to this
);
A few notes:
reference = this should be something unique that explains what you did, you can then search for log entries according to these reference.
log entry = if you are using template tags, make sure you do not parse them before saving into the database. they are parsed first when they are retrieved from the database.
ref id = this is used to store reference ids for example the ID of the post you purchased or the user ID to whom you transferred points to. It can not be anything but integers!
data = you can use this column to anything you want, any extra info you might want to save. Remember that if you use template tags in your log entry this should contain an array with the ref_type key to indicate to myCRED what the ref id is referring to (i.e. user / post / comment).
Finally, if you decide to use the mycred_get_settings function, you also gain access to the same functions the add and subtract functions use!
Example: Add points using mycred_get_settings():
// init myCRED
$mycred = mycred_get_settings();
// Add points
$mycred->add_points( 'manual', 1, 10, 'My custom log entry' );
You deduct points by passing on a negative value for the amount of points. So awarding -10 points will deduct 10 points from the user.
It uses the same arguments as the add_to_log method.
Fore more info check out the mycred_get_settings doc or the doc for the myCRED_Settings class.