katzgrau/KLogger

Set some Properties and Methods from private to protected

Sysix opened this issue · 6 comments

Sysix commented

Hello Guys,

at first, thanks for this simple Class!
But I have some problems with it.

I would like to extend the Class for Read the file. But some Properties and Methods are on private, so I can not use it on my child class.

Example: $fileHandle & $logFilePath

Thanks. Greetz Sysix

Hi Sysix. What's your particular use case? Just curious

Sysix commented

I want to read the file line by line. and extend the method "getLastLogLine" with it.
So that fileHandle is on private i can use the core handle and must make a self alone method.
Not pretty^^

👍 Same problem here. It's not possible to add your own functions to the Klogger class because you cant extend a new class from the Klogger class. The file handle should be declared as protected so other users can extend their classes from the Klogger class.

How's that?

Brilliant, thanks! :)

Sysix commented

👍 thanks