Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
More verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaber-de committed Jan 29, 2016
1 parent 6645f3d commit 0e88039
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions inc/Controller/TmpLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function( $upload, $import_post ) use ( $logger ) {
add_action(
'w2m_import_set_comment_id',
/**
* @type Type\ImportCommentInterface $import_comment
* @param Type\ImportCommentInterface $import_comment
*/
function( Type\ImportCommentInterface $import_comment ) use ( $logger ) {

Expand All @@ -171,7 +171,7 @@ function( Type\ImportCommentInterface $import_comment ) use ( $logger ) {
add_action(
'w2m_import_set_post_id',
/**
* @type Type\ImportPostInterface $import_post
* @param Type\ImportPostInterface $import_post
*/
function( Type\ImportPostInterface $import_post ) use ( $logger ) {

Expand All @@ -187,7 +187,7 @@ function( Type\ImportPostInterface $import_post ) use ( $logger ) {
add_action(
'w2m_import_set_term_id',
/**
* @type Type\ImportUserInterface $import_term
* @param Type\ImportUserInterface $import_term
*/
function( Type\ImportTermInterface $import_term ) use ( $logger ) {

Expand All @@ -203,7 +203,7 @@ function( Type\ImportTermInterface $import_term ) use ( $logger ) {
add_action(
'w2m_import_set_user_id',
/**
* @type Type\ImportUserInterface $import_user
* @param Type\ImportUserInterface $import_user
*/
function( Type\ImportUserInterface $import_user ) use ( $logger ) {

Expand All @@ -216,5 +216,28 @@ function( Type\ImportUserInterface $import_user ) use ( $logger ) {
);
}
);

add_action(
'w2m_import_missing_post_local_user_id',
/**
* @param WP_Error
* @param Type\ImportPostInterface
*/
function( WP_Error $error, Type\ImportPostInterface $import_post ) use ( $logger ) {

$code = $error->get_error_code();
$msg = $error->get_error_message( $code );

$logger->warning(
$msg,
[
'origin_post_id' => $import_post->origin_id(),
'type' => $import_post->type()
]
);
},
10,
2
);
}
}

0 comments on commit 0e88039

Please sign in to comment.