Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History file initialization #193

Open
tas-unn opened this issue Feb 19, 2024 · 4 comments
Open

History file initialization #193

tas-unn opened this issue Feb 19, 2024 · 4 comments
Labels
question Further information is requested

Comments

@tas-unn
Copy link

tas-unn commented Feb 19, 2024

I wanted to make it so that after restarting the application the talker would save the history in my application. In theory, to do this you need to save the history to a file, and then pick up this file during initialization

--

Хотел сделать в своём приложении так, чтобы после перезапуска приложения талкер сохранял историю. По идее для этого нужно сохранять историю в файл, а потом при инициализации подцеплять этот файл

@Frezyx
Copy link
Owner

Frezyx commented Mar 19, 2024

Hi @tas-unn!

Yes, you can currently save the log history to a file and read it on restart. However, you will need to create an adapter to save data in database format and read it.

To inject the required logs when starting the project, use the history field in the constructor or the config method:

--

Привет tas-unn !
Да, ты можешь прямо сейчас сохранить историю логов в файл и прочитать её при перезаходе.
Но тогда понадобится сделать адаптер для сохранения данных в формат базы данных и чтение.

Чтобы при запуске проекта подставить нужные тебе логи - воспользуйся полем history в конструкторе или методе config

TalkerHistory? history,

@Frezyx Frezyx added the question Further information is requested label Mar 29, 2024
@tas-unn
Copy link
Author

tas-unn commented Apr 1, 2024

я создал класс class MyTalkerHistory extends TalkerHistory и имплементировал 3 метода (clean, write, read). Если я хочу записать файл, там объект ТалкерДата. Как мне его запихнуть в файл (например FllutterSecurityStorage или Shared_Preferences) и затем прочитать? все методы синхронные, а запись и чтение обычно асинхронные. Плюс конвертация TalkerData как должна происходить?

I created a class class MyTalkerHistory extends TalkerHistory and implemented 3 methods (clean, write, read). If I want to write a file, there is a TalkerData object there. How can I put it into a file (for example FlutterSecurityStorage or Shared_Preferences) and then read it? All methods are synchronous, while writing and reading are usually asynchronous. Plus, how should TalkerData be converted?

@XanderD99
Copy link

@tas-unn you would have to convert the talker data into some format you want (maybe json) and write that as a string to a file or database.

It is however impossible to convert back to TalkerData if you want to read from that file as well. But I created a separate Feature Request for that. #218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants
@XanderD99 @Frezyx @tas-unn and others