Milad-Akarie / pretty_dio_logger

MIT License
221 stars 49 forks source link

Please support dio 3.0.0 #1

Closed wendux closed 4 years ago

wendux commented 4 years ago

We have released version 3.0 of Dio, could you support it ?We may archive this plugin in the Dio documentation after it supports Dio 3.0. thanks

timrijckaert commented 4 years ago

It would also be nice if the output could somehow be capture externally so we can write it to a file.

Milad-Akarie commented 4 years ago

@wendux it's done. it would be nice to have it mentioned in your documentation.

Milad-Akarie commented 4 years ago

@timrijckaert you can now provide your own logging function just like in the default dio logger.

timrijckaert commented 4 years ago

I don't want a different output, I want the output you already have. However the way this lib is setup is that it does not expose this output.

Why not provide an optional delegate in the constructor which you can call with the same output as what you send to the console?

PrettyDioLogger(outputDelegate: (consoleLog) => ... );
Milad-Akarie commented 4 years ago

@timrijckaert With the current setup, you can do exactly what you want

PrettydioLogger(logPrint : (logMessage) =>  // do what you want with the output );

// if you still need to log to the console, you can do something like this
PrettydioLogger(logPrint : (logMessage) {  
 print(logMessage);
 // do what you want with the output
  writeToFile(logMessage);
});
timrijckaert commented 4 years ago

Awesome! I didn't see it!