I am trying to make my log method to be generic. What I need as the main concept is as below:

```
class A {
    user_id: number;
    // and some other props...
}

class B {
    service_name: string;
    // and some other props...
}

function log<T>(...T parameters) {
    // logging the input parameters
}

log<A>(
    A.user_id = 123
);

log<B>(
    B.service_name = 'my_service_name';
);

```

What I have tried so far is as below, but I cannot make it working. I am doing this, because my project is getting bigger and more levels and entries would be added day-to-day.

```
enum levels {
    error,
    info,
}

enum entries {
    user_id,
    service_name,
}

function log(level: levels, ...entries: entries[]) {
    // perform the actual log...
}

log(
    levels.info,
    entries.user_id = 123
);

log(
    levels.error,
    entries.service_name = 'my_sevice_name'    
);

```

The reason that I have used enums in my example, is that I wanted to force the developer to choose a predefined value from a list and not to use magic numbers or magic strings.