#include <iostream>
#include <string>
#include <vector>
#include <random>
#include "Log.h"
#include "Log.cpp"
#include "Passgen.h"

using namespace std;

#ifndef PASSGEN
#define PASSGEN

class Options {
    public:
    virtual bool lower() const = 0;
    virtual bool upper() const = 0;
    virtual bool nums() const = 0;
    virtual bool specchars() const = 0;
    virtual int len() const = 0;
};

class Fabric {
    public:
    virtual string gen_password() const = 0;
};

class PassOptions : public Options {
    bool addlower;
    bool addupper;
    bool addnums;
    bool addspec;
    int passlen;

    public:
    PassOptions(bool lower, bool upper, bool nums, bool spec, int len)
        : addlower(lower), addupper(upper), addnums(nums), addspec(spec), passlen(len) {}

    bool lower() const override { 
        return addlower; 
    }

    bool upper() const override { 
        return addupper; 
    }

    bool nums() const override { 
        return addnums; 
    }

    bool specchars() const override { 
        return addspec; 
    }

    int len() const override { 
        return passlen; 
    }
};

class PassFabric : public Fabric {

    Options &options;

    char randomChar(const string &category) const {
        static mt19937 rng(random_device{}());
        uniform_int_distribution<> dist(0, category.length() - 1);
        return category[dist(rng)];
    }

    public:
    PassFabric(Options &opts) : options(opts) {}

    string gen_password() const override {
        Log::get_ekzempl().write("ИНФО", "Запущен процесс ввода параметров");
        string allowedChars;
        if (options.lower()) allowedChars += "abcdefghijklmnopqrstuvwxyz";
        if (options.upper()) allowedChars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        if (options.nums()) allowedChars += "0123456789";
        if (options.specchars()) allowedChars += "!@#$%^&*()_-+=<>?";
Log::get_ekzempl().write("ИНФО", "Запущен процесс ввода параметров");
        if (allowedChars.empty()) throw runtime_error("No characters are allowed for password generation");
        
        string password;
        for (int i = 0; i < options.len(); ++i) {
            password += randomChar(allowedChars);
        }
        return password;
    }
};

class Com {
public:
    virtual void execute() = 0;
};

class PassGenCom : public Com {
private:
    const Fabric &factory;
    int numberOfPasswords;
    vector<string> &passwords;

public:
    PassGenCom(const Fabric &f, int numPasswords, vector<string> &p)
        : factory(f), numberOfPasswords(numPasswords), passwords(p) {}

    void execute() override {
        Log::get_ekzempl().write("ИНФО", "Запущен процесс ввода параметров");
        try {
            for (int i = 0; i < numberOfPasswords; ++i) {
                passwords.push_back(factory.gen_password());
            }
        } catch (const exception &e) {
            throw;
        }
    }
};

class PassCheck {
public:
    static bool normal_password(const string &password) {
        int score = 0;
        Log::get_ekzempl().write("ИНФО", "Запущен процесс ввода параметров");
        for (char ch : password) {
            if (islower(ch)) score += 1;
            else if (isupper(ch)) score += 2;
            else if (isdigit(ch)) score += 3;
            else score += 5;
        }
        return score > 10;
    }
};
#endif

Please make function randomChar() more simplier. Don't use rng, dist, uniform_int_distribution.