diff --git a/libtar/extract.c b/libtar/extract.c
index 08e2914..85e3e40 100755
--- a/libtar/extract.c
+++ b/libtar/extract.c
@@ -65,7 +65,7 @@
 	ut.modtime = ut.actime = th_get_mtime(t);
 
 #ifdef DEBUG
-	printf("tar_set_file_perms(): setting perms: %s (mode %04o, uid %d, gid %d)\n",
+	LOG("tar_set_file_perms(): setting perms: %s (mode %04o, uid %d, gid %d)\n",
 		filename, mode, uid, gid);
 #endif
 
@@ -167,7 +167,7 @@
 	if((t->options & TAR_STORE_SELINUX) && t->th_buf.selinux_context != NULL)
 	{
 #ifdef DEBUG
-		printf("tar_extract_file(): restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname);
+		LOG("tar_extract_file(): restoring SELinux context %s to file %s\n", t->th_buf.selinux_context, realname);
 #endif
 		if (lsetfilecon(realname, t->th_buf.selinux_context) < 0)
 			fprintf(stderr, "tar_extract_file(): failed to restore SELinux context %s to file %s !!!\n", t->th_buf.selinux_context, realname);
@@ -176,7 +176,7 @@
 	if((t->options & TAR_STORE_POSIX_CAP) && t->th_buf.has_cap_data)
 	{
 #if 1 //def DEBUG
-		printf("tar_extract_file(): restoring posix capabilities to file %s\n", realname);
+		LOG("tar_extract_file(): restoring posix capabilities to file %s\n", realname);
 		print_caps(&t->th_buf.cap_data);
 #endif
 		if (setxattr(realname, XATTR_NAME_CAPS, &t->th_buf.cap_data, sizeof(struct vfs_cap_data), 0) < 0)
@@ -193,7 +193,7 @@
 	strcpy(&lnp[0], pn);
 	strcpy(&lnp[pathname_len], realname);
 #ifdef DEBUG
-	printf("tar_extract_file(): calling libtar_hash_add(): key=\"%s\", "
+	LOG("tar_extract_file(): calling libtar_hash_add(): key=\"%s\", "
 	       "value=\"%s\"\n", pn, realname);
 #endif
 	if (libtar_hash_add(t->h, lnp) != 0)
@@ -217,7 +217,7 @@
 	char *pn;
 
 #ifdef DEBUG
-	printf("  ==> tar_extract_regfile(realname=\"%s\")\n", realname);
+	LOG("  ==> tar_extract_regfile(realname=\"%s\")\n", realname);
 #endif
 
 	if (!TH_ISREG(t))
@@ -233,7 +233,7 @@
 	if (mkdirhier(dirname(filename)) == -1)
 		return -1;
 
-	printf("  ==> extracting: %s (file size %" PRId64 " bytes)\n",
+	LOG("  ==> extracting: %s (file size %" PRId64 " bytes)\n",
 			filename, size);
 
 	fdout = open(filename, O_WRONLY | O_CREAT | O_TRUNC
@@ -280,7 +280,7 @@
 		return -1;
 
 #ifdef DEBUG
-	printf("### done extracting %s\n", filename);
+	LOG("### done extracting %s\n", filename);
 #endif
 
 	return 0;
@@ -353,7 +353,7 @@
 	newtgt = strdup(linktgt);
 	sprintf(linktgt, "%s/%s", prefix, newtgt);
 
-	printf("  ==> extracting: %s (link to %s)\n", filename, linktgt);
+	LOG("  ==> extracting: %s (link to %s)\n", filename, linktgt);
 
 	if (link(linktgt, filename) == -1)
 	{
@@ -386,7 +386,7 @@
 	if (unlink(filename) == -1 && errno != ENOENT)
 		return -1;
 
-	printf("  ==> extracting: %s (symlink to %s)\n",
+	LOG("  ==> extracting: %s (symlink to %s)\n",
 	       filename, th_get_linkname(t));
 
 	if (symlink(th_get_linkname(t), filename) == -1)
@@ -425,7 +425,7 @@
 	if (mkdirhier(dirname(filename)) == -1)
 		return -1;
 
-	printf("  ==> extracting: %s (character device %ld,%ld)\n",
+	LOG("  ==> extracting: %s (character device %ld,%ld)\n",
 	       filename, devmaj, devmin);
 
 	if (mknod(filename, mode | S_IFCHR,
@@ -463,7 +463,7 @@
 	if (mkdirhier(dirname(filename)) == -1)
 		return -1;
 
-	printf("  ==> extracting: %s (block device %ld,%ld)\n",
+	LOG("  ==> extracting: %s (block device %ld,%ld)\n",
 	       filename, devmaj, devmin);
 
 	if (mknod(filename, mode | S_IFBLK,
@@ -496,7 +496,7 @@
 	if (mkdirhier(dirname(filename)) == -1)
 		return -1;
 
-	printf("  ==> extracting: %s (mode %04o, directory)\n", filename,
+	LOG("  ==> extracting: %s (mode %04o, directory)\n", filename,
 	       mode);
 
 	if (mkdir(filename, mode) == -1)
@@ -531,7 +531,7 @@
 	{
 		if (t->th_buf.has_user_default) {
 #if 1 //def DEBUG
-			printf("tar_extract_file(): restoring android user.default xattr to %s\n", realname);
+			LOG("tar_extract_file(): restoring android user.default xattr to %s\n", realname);
 #endif
 			if (setxattr(realname, "user.default", NULL, 0, 0) < 0) {
 				fprintf(stderr, "tar_extract_file(): failed to restore android user.default to file %s !!!\n", realname);
@@ -540,14 +540,14 @@
 		}
 		if (t->th_buf.has_user_cache) {
 #if 1 //def DEBUG
-			printf("tar_extract_file(): restoring android user.inode_cache xattr to %s\n", realname);
+			LOG("tar_extract_file(): restoring android user.inode_cache xattr to %s\n", realname);
 #endif
 			if (write_path_inode(realname, "cache", "user.inode_cache"))
 				return -1;
 		}
 		if (t->th_buf.has_user_code_cache) {
 #if 1 //def DEBUG
-			printf("tar_extract_file(): restoring android user.inode_code_cache xattr to %s\n", realname);
+			LOG("tar_extract_file(): restoring android user.inode_code_cache xattr to %s\n", realname);
 #endif
 			if (write_path_inode(realname, "code_cache", "user.inode_code_cache"))
 				return -1;
@@ -568,7 +568,7 @@
 #else
 		bytes_to_hex(t->th_buf.fep->master_key_identifier, FSCRYPT_KEY_IDENTIFIER_SIZE, policy_hex);
 #endif
-		printf("tar_extract_dir(): restoring fscrypt policy %s to dir %s\n", (char *)policy_hex, realname);
+		LOG("tar_extract_dir(): restoring fscrypt policy %s to dir %s\n", (char *)policy_hex, realname);
 #endif
 		bool policy_lookup_error = false;
 #ifdef USE_FSCRYPT_POLICY_V1
@@ -581,14 +581,14 @@
 
 #ifdef USE_FSCRYPT_POLICY_V1
 		if (!lookup_ref_tar(t->th_buf.fep->master_key_descriptor, &binary_policy[0])) {
-			printf("error looking up fscrypt policy for '%s' - %s\n", realname, t->th_buf.fep->master_key_descriptor);
+			LOG("error looking up fscrypt policy for '%s' - %s\n", realname, t->th_buf.fep->master_key_descriptor);
 			policy_lookup_error = true;
 		}
 		memcpy(&t->th_buf.fep->master_key_descriptor, binary_policy, FS_KEY_DESCRIPTOR_SIZE);
 		bytes_to_hex(t->th_buf.fep->master_key_descriptor, FS_KEY_DESCRIPTOR_SIZE, policy_hex);
 #else
 		if (!lookup_ref_tar(t->th_buf.fep->master_key_identifier, &binary_policy[0])) {
-			printf("error looking up fscrypt policy for '%s' - %s\n", realname, t->th_buf.fep->master_key_identifier);
+			LOG("error looking up fscrypt policy for '%s' - %s\n", realname, t->th_buf.fep->master_key_identifier);
 			policy_lookup_error = true;
 		}
 		memcpy(&t->th_buf.fep->master_key_identifier, binary_policy, FSCRYPT_KEY_IDENTIFIER_SIZE);
@@ -596,17 +596,17 @@
 #endif
 		if (!policy_lookup_error) 
 		{
-			printf("attempting to restore policy: %s\n", policy_hex);
+			LOG("attempting to restore policy: %s\n", policy_hex);
 			if (!fscrypt_policy_set_struct(realname, t->th_buf.fep))
 			{
-				printf("tar_extract_file(): failed to restore fscrypt policy to dir '%s' '%s'!!!\n", realname, policy_hex);
+				LOG("tar_extract_file(): failed to restore fscrypt policy to dir '%s' '%s'!!!\n", realname, policy_hex);
 				//return -1; // This may not be an error in some cases, so log and ignore
 			}
 		} else
-			printf("No policy was found. Continuing restore.");
+			LOG("No policy was found. Continuing restore.");
 	}
 	else
-		printf("NULL FSCRYPT\n");
+		LOG("NULL FSCRYPT\n");
 #endif
 
 	return 0;
@@ -635,7 +635,7 @@
 		return -1;
 
 
-	printf("  ==> extracting: %s (fifo)\n", filename);
+	LOG("  ==> extracting: %s (fifo)\n", filename);
 
 	if (mkfifo(filename, mode) == -1)
 	{
@@ -657,7 +657,7 @@
 	ssize_t k;
 
 #ifdef DEBUG
-	printf("  ==> tar_extract_file_contents\n");
+	LOG("  ==> tar_extract_file_contents\n");
 #endif
 
 	if (!TH_ISREG(t))
@@ -698,7 +698,7 @@
 	*lenp = (size_t)size;
 
 #ifdef DEBUG
-	printf("### done extracting contents\n");
+	LOG("### done extracting contents\n");
 #endif
 	return 0;
 }
