log an Assert (the result of a functionality validation test) as validated
@param $message
@param null $object optional: reference an object which is important to understand the log entry
323261
public function logAssertValidated($message, $object = null)
    {
        $this->doLog(LogHelper::LOG_LEVEL_ASSERT_VALIDATED, $message, $object);
    }
1355674
public function success(?string $message = null): Log
    {
        if (!is_null($message)) {
            $this->message = $message;
        }
        $this->type = 'success';
        Alertify::flash();
        return $this;
    }
1293338
private function tryLogMessage($message)
    {
        $messageId = null;

        if ($message instanceof RemoteMessage) $messageId = $message->header()->uuid();
        elseif ($message instanceof ProcessingMessage) $messageId = $message->uuid();

        if (! $messageId) return;

        $entry = $this->messageLogger->getEntryForMessageId($messageId);

        if ($entry) return;

        $this->messageLogger->logIncomingMessage($message);
    }
553971
public function logMessage(Message $message): void
    {
        if (in_array($message->getLevel(), $this->config['log']) && !$this->inserting) {
            if ($this->insertFn !== null) {
                $insert = call_user_func($this->insertFn, $message, $this->config);

                if ($insert !== null) {

                    if (!is_object($insert)) {
                        throw new Exception('\'get_insert_fn\' function must return an instance of Insert; instead got type of ' . gettype($insert));
                    } else {
                        // it is object, but what type
                        if (!($insert instanceof Insert)) {
                            throw new Exception('\'get_insert_fn\' function must return an instance of Insert; instead got instance of ' . get_class($insert));
                        }
                    }

                }
            } else {
                $data = [
                  'time' => $message->getTime()->format('Y-m-d H:i:s'),
                  'level' => $message->getLevel(),
                  'who' => $message->getWho() ?? Log::getWho(),
                  'message' => $message->getMessage()
                ];

                $insert = new Insert($this->getTableName(), $data, $this->getAdapterConnection());
            }

            if ($insert !== null) {
                $this->inserting = true;

                try {

                    Log::temporaryDisable();
                    $insert->exec();

                } catch (\Exception $e) {
                    throw $e;

                } finally {
                    Log::restoreTemporaryDisablement();
                    // @todo write tests for failures
                    $this->inserting = false;
                }
            }
        }
    }
608633
public function notInstanceOf($object, $class, $message = '')
    {
        $this->assertion->setActual($object);

        return $this->assertion->is->not->instanceof($class, $message);
    }
51018
public void validateNull(Object object, String name) {
        validateNull(object, name, messages.get(Validation.NULL_KEY.name(), name));
    }
778821
public static void assertEquals(String message, Object expected, Object actual) {
        if (expected == null && actual != null || expected != null && !expected.equals(actual)) {
            fail(message);
        }
    }
987664
public function log($level, $message, $object = '')
    {
        if ($this->shouldIgnoreThisLog($level)) {
            return;
        }
        $msg = $this->generateLog($level, $message, $object);
        $target_file = $this->decideTargetFile();
        if (!$target_file) {
            echo $msg;
            return;
        }
        @file_put_contents($target_file, $msg, FILE_APPEND);
    }
1189216
protected function validateObject($object)
    {
        $classSchema = $this->reflectionService->getClassSchema($object);
        $validator = $this->validatorResolver->getBaseValidatorConjunction($classSchema->getClassName());
        if ($validator === null) {
            return;
        }
        $validationResult = $validator->validate($object);
        if ($validationResult->hasErrors()) {
            $errorMessages = '';
            $allErrors = $validationResult->getFlattenedErrors();
            foreach ($allErrors as $path => $errors) {
                $errorMessages .= $path . ':' . PHP_EOL;
                foreach ($errors as $error) {
                    $errorMessages .= (string)$error . PHP_EOL;
                }
            }
            throw new ObjectValidationFailedException('An instance of "' . get_class($object) . '" failed to pass validation with ' . count($errors) . ' error(s): ' . PHP_EOL . $errorMessages, 1322585162);
        }
    }
1007092
public function fatal( $object , $category , $message )
	{
		$this->message( self::getMessagePrefix( $object , $category , 'fatal' ) . $message , self::LEVEL_FATAL );

		throw new Exception( $message );
	}
1253834
public function notDeepProperty($object, $property, $message = '')
    {
        $this->assertion->setActual($object);

        return $this->assertion->to->not->have->deep->property($property, null, $message);
    }
1114457
public function logFatal($message, $object = null)
    {
        $this->doLog(LogHelper::LOG_LEVEL_FATAL, $message, $object);
    }
1004965
public function property($object, $property, $message = '')
    {
        $this->assertion->setActual($object);

        return $this->assertion->to->have->property($property, null, $message);
    }
1041911
public static void assertNotNull(String message, Object o) {
        if (o != null) {
            pass(message);
        } else {
            fail(message, null);
        }
    }
872042
public function logValidationError($validationType, $messageException = null, $method = null, $line = null)
    {
        if (self::getConfig('log', 'validation')) {
            $this->logMessage("VALIDATE][KO][{$validationType}", "{$messageException} --- " . $this->__toString() . "\n", $method, $line);
        }
        //file_put_contents('php://stderr', "[" . date('Y-m-d H:i:s') . "][VALIDATION][KO][{{$method}#{$line}][{$validationType}] : {$messageException} --- " . $this->__toString() . "\n");
    }
1080891
private function checkScope(Entity &$object)
	{
		if ( ! empty($this->localization) && ! empty($this->block)) {
			try {
				// do not-strict match (allows page data with template block)
				$this->localization->matchDiscriminator($this->block);
			} catch (\Exception $e) {
				$object = null;
				throw $e;
			}
		}
	}
115137
public static void assertTrue(String message, boolean value) {
        if (value) {
            pass(message);
        } else {
            fail(message, null);
        }
    }