ESPLogger icon indicating copy to clipboard operation
ESPLogger copied to clipboard

LoggerSPIFFS in a class

Open dduehren opened this issue 3 years ago • 9 comments

Since your library is at a pretty low level - append(string)., I'm building a class to make structured records to append, so your libary is part of that class.

The problem that I'm having is that if I try to instantiate LoggerSpiffs mylog("/log/mylog.log") in my class, the compiler complains, but if I move it to my main. ino file, it works. Do you know why this would be?

I can pass it in, as long as LoggerSPIFFS is recognized as a type for my private copy.

Regard,

David Duehren

dduehren avatar Mar 07 '21 19:03 dduehren

Really wish you'd respond to this. I can't use your library in my own class because I haven't found a way to use LoggerSPIFFS as a type to define a private logger in my class. I can pass the logger to my class by reference, but I can't make a copy of it. Next is to try via the constructor. Ideally I'd just be able to have the logger inside my class and not have to do shit like this.

dduehren avatar Mar 11 '21 03:03 dduehren

For now, declaring it as external is compiling.

dduehren avatar Mar 11 '21 03:03 dduehren

Sorry for late reply, I will look into it as soon as possible (probably by the end of the week)

fabianoriccardi avatar Mar 11 '21 08:03 fabianoriccardi

Thanks

Sent from my iPhone

David Duehren

On Mar 11, 2021, at 12:38 AM, Fabiano Riccardi @.***> wrote:

 Sorry for late reply, I will look into it as soon as possible

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

dduehren avatar Mar 11 '21 18:03 dduehren

Hi David, how are you instantiating LoggerSPIFFS? Can you share the snippet of code to replicate this behavior?

fabianoriccardi avatar Mar 14 '21 14:03 fabianoriccardi

Did you solved the issue?

fabianoriccardi avatar Mar 21 '21 09:03 fabianoriccardi

No I sent you what I tried and the compiler errors

Sent from my iPhone

David Duehren

On Mar 21, 2021, at 2:10 AM, Fabiano Riccardi @.***> wrote:

 Did you solved the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

dduehren avatar Mar 21 '21 21:03 dduehren

I'm not looking at LITTLEFS, How do I configure for this? Thanks

dduehren avatar Aug 11 '21 20:08 dduehren

Is it just commenting the define in logger_spiffs.cpp? Does anything else need to change?

dduehren avatar Aug 11 '21 21:08 dduehren