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

Feature/log extension #192

Merged
merged 3 commits into from
Feb 4, 2025
Merged

Feature/log extension #192

merged 3 commits into from
Feb 4, 2025

Conversation

mesaglio
Copy link
Contributor

With this we can have less group logs in github
cc @RaniAgus @nahuemazzeo

@mesaglio mesaglio force-pushed the feature/log_extension branch from 667ead0 to 4b7ba90 Compare December 23, 2024 16:37
iago64
iago64 previously approved these changes Dec 23, 2024
src/commons/log.c Outdated Show resolved Hide resolved
@@ -44,6 +44,11 @@ static bool _is_level_enabled(t_log* logger, t_log_level level);


t_log* log_create(char* file, char *program_name, bool is_active_console, t_log_level detail) {
if (!string_ends_with(file, ".log")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abajo hay un chequeo de if (file != NULL), por lo que entendería que la API soporta pasarle un file nulo y solo imprimir por consola.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revisando eso, creo que lo mejor que podemos hacer es ahí apprendear el .log al final del nombre al momento de llamar a file_opened = txt_open_for_append(file); y que les quede de ultima un archivo llamado kernel.log.log, total les va a quedar una vez y a la segunda ya lo "arreglan"

@mesaglio mesaglio force-pushed the feature/log_extension branch 2 times, most recently from dad0842 to 06fd126 Compare February 4, 2025 01:21
@mesaglio mesaglio force-pushed the feature/log_extension branch from 06fd126 to d2c35a2 Compare February 4, 2025 01:22
@mesaglio
Copy link
Contributor Author

mesaglio commented Feb 4, 2025

Ahi quedo el cambio con el comment de agus, de hacerlo solo cuando file no es NULL. Como dice Dami, concuerdo que el archivo de log use la extension .log pero prefiero que lo tengan que especificar los clientes de la lib.

@mesaglio mesaglio merged commit c7f1e5c into master Feb 4, 2025
1 check passed
@mesaglio mesaglio deleted the feature/log_extension branch February 4, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants