Uncommon logger levels in Friendica (#5453)
* "normal" is an uncommon logger level: - changed LOGGER_NORMAL -> LOGGER_INFO - added LOGGER_WARNING (a common logger level) * Used constants instead of values (MrPetovan)
This commit is contained in:
		
					parent
					
						
							
								a202962f03
							
						
					
				
			
			
				commit
				
					
						c17adaf333
					
				
			
		
					 7 changed files with 29 additions and 25 deletions
				
			
		| 
						 | 
				
			
			@ -142,7 +142,7 @@ class UserImport
 | 
			
		|||
		// import user
 | 
			
		||||
		$r = self::dbImportAssoc('user', $account['user']);
 | 
			
		||||
		if ($r === false) {
 | 
			
		||||
			logger("uimport:insert user : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
			logger("uimport:insert user : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
			notice(L10n::t("User creation error"));
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -160,7 +160,7 @@ class UserImport
 | 
			
		|||
			$profile['uid'] = $newuid;
 | 
			
		||||
			$r = self::dbImportAssoc('profile', $profile);
 | 
			
		||||
			if ($r === false) {
 | 
			
		||||
				logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
				logger("uimport:insert profile " . $profile['profile-name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
				info(L10n::t("User profile creation error"));
 | 
			
		||||
				DBA::delete('user', ['uid' => $newuid]);
 | 
			
		||||
				return;
 | 
			
		||||
| 
						 | 
				
			
			@ -198,7 +198,7 @@ class UserImport
 | 
			
		|||
			$contact['uid'] = $newuid;
 | 
			
		||||
			$r = self::dbImportAssoc('contact', $contact);
 | 
			
		||||
			if ($r === false) {
 | 
			
		||||
				logger("uimport:insert contact " . $contact['nick'] . "," . $contact['network'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
				logger("uimport:insert contact " . $contact['nick'] . "," . $contact['network'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
				$errorcount++;
 | 
			
		||||
			} else {
 | 
			
		||||
				$contact['newid'] = self::lastInsertId();
 | 
			
		||||
| 
						 | 
				
			
			@ -212,7 +212,7 @@ class UserImport
 | 
			
		|||
			$group['uid'] = $newuid;
 | 
			
		||||
			$r = self::dbImportAssoc('group', $group);
 | 
			
		||||
			if ($r === false) {
 | 
			
		||||
				logger("uimport:insert group " . $group['name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
				logger("uimport:insert group " . $group['name'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
			} else {
 | 
			
		||||
				$group['newid'] = self::lastInsertId();
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -237,7 +237,7 @@ class UserImport
 | 
			
		|||
			if ($import == 2) {
 | 
			
		||||
				$r = self::dbImportAssoc('group_member', $group_member);
 | 
			
		||||
				if ($r === false) {
 | 
			
		||||
					logger("uimport:insert group member " . $group_member['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
					logger("uimport:insert group member " . $group_member['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			@ -255,7 +255,7 @@ class UserImport
 | 
			
		|||
			);
 | 
			
		||||
 | 
			
		||||
			if ($r === false) {
 | 
			
		||||
				logger("uimport:insert photo " . $photo['resource-id'] . "," . $photo['scale'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
				logger("uimport:insert photo " . $photo['resource-id'] . "," . $photo['scale'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -263,7 +263,7 @@ class UserImport
 | 
			
		|||
			$pconfig['uid'] = $newuid;
 | 
			
		||||
			$r = self::dbImportAssoc('pconfig', $pconfig);
 | 
			
		||||
			if ($r === false) {
 | 
			
		||||
				logger("uimport:insert pconfig " . $pconfig['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_NORMAL);
 | 
			
		||||
				logger("uimport:insert pconfig " . $pconfig['id'] . " : ERROR : " . DBA::errorMessage(), LOGGER_INFO);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -61,7 +61,7 @@ class DBStructure
 | 
			
		|||
 | 
			
		||||
		// No valid result?
 | 
			
		||||
		if (!DBM::is_result($adminlist)) {
 | 
			
		||||
			logger(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), LOGGER_NORMAL);
 | 
			
		||||
			logger(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), LOGGER_INFO);
 | 
			
		||||
 | 
			
		||||
			// Don't continue
 | 
			
		||||
			return;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -134,7 +134,7 @@ class DFRN
 | 
			
		|||
		);
 | 
			
		||||
 | 
			
		||||
		if (! DBM::is_result($r)) {
 | 
			
		||||
			logger(sprintf('No contact found for nickname=%d', $owner_nick), LOGGER_NORMAL);
 | 
			
		||||
			logger(sprintf('No contact found for nickname=%d', $owner_nick), LOGGER_WARNING);
 | 
			
		||||
			killme();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -170,7 +170,7 @@ class DFRN
 | 
			
		|||
			);
 | 
			
		||||
 | 
			
		||||
			if (! DBM::is_result($r)) {
 | 
			
		||||
				logger(sprintf('No contact found for uid=%d', $owner_id), LOGGER_NORMAL);
 | 
			
		||||
				logger(sprintf('No contact found for uid=%d', $owner_id), LOGGER_WARNING);
 | 
			
		||||
				killme();
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -220,7 +220,7 @@ class Network
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		if (curl_errno($ch) !== CURLE_OK) {
 | 
			
		||||
			logger('error fetching ' . $url . ': ' . curl_error($ch), LOGGER_NORMAL);
 | 
			
		||||
			logger('error fetching ' . $url . ': ' . curl_error($ch), LOGGER_INFO);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		$ret['errno'] = curl_errno($ch);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue