fabianoriccardi / ESPLogger

An Arduino library providing a minimal interface to log data on flash memory and SD cards with ESP8266 and ESP32.
GNU Lesser General Public License v2.1
82 stars 15 forks source link

LoggerSPIFFS in a class #10

Open dduehren opened 3 years ago

dduehren commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

For now, declaring it as external is compiling.

fabianoriccardi commented 3 years ago

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

dduehren commented 3 years ago

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.

fabianoriccardi commented 3 years ago

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

fabianoriccardi commented 3 years ago

Did you solved the issue?

dduehren commented 3 years ago

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 commented 3 years ago

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

dduehren commented 3 years ago

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