Tâche #12304
Distribution EOLE - Scénario #13500: Assistance aux utilisateurs (42-44)
Eqos : Erreur formatage de la date dans la fonction make_log (eqosd.pl)
Description
Bonjour,
Il y a une erreur dans le script /usr/share/eqos/eqosd.pl dans la fonction make_log (ligne 154). Il faut ajouter +1 à la variable $mon pour que le mois soit correcte au niveau du fichier de log /var/log/eqos.log.
extrait:
sub make_log {
my ($lvl, $str) = @_;
if ($lvl <= $debuglevel) {
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday) = gmtime();
$mon += 1;
print WHITE . sprintf("%02d/%02d %02d:%02d:%02d", $mday, $mon, $hour, $min, $sec) . " [$globalname] $str" . RESET . "\n";
}
}
Ref:
http://perldoc.perl.org/functions/gmtime.html
http://perldoc.perl.org/functions/localtime.html
Cordialement,
Yoni
Associated revisions
Correction du formatage de la date dans les logs
- eqos/eqosd.pl : décalage d'un mois ($mon+1)
Ref: #12304 @30m
History
#1 Updated by Joël Cuissinat about 8 years ago
Problème remonté au pôle de Nancy-Metz.
#2 Updated by Joël Cuissinat almost 8 years ago
- Tracker changed from Anomalie to Demande
Je confirme le bug et en l'absence de réponse des différents interlocuteurs, je propose de corriger dans la version que nous diffusons...
root@scribe:~# date vendredi 23 octobre 2015, 19:19:54 (UTC+0200) root@scribe:~# tail -n2 /var/log/eqos.log 23/09 17:19:55 [eqosd] info : task "feedback", time not expired (262s) 23/09 17:19:55 [eqosd] info : checker is ok, continuing...
#3 Updated by Joël Cuissinat almost 8 years ago
- Tracker changed from Demande to Tâche
- Status changed from Nouveau to En cours
- Assigned To set to Joël Cuissinat
- Estimated time set to 2.00 h
- Parent task set to #13500
- Remaining (hours) set to 2.0
#4 Updated by Joël Cuissinat almost 8 years ago
- % Done changed from 0 to 100
- Remaining (hours) changed from 2.0 to 0.5
Corrigé dans branche 2.4.0/12304-fix-date-log réalisée depuis 2.4.0/master
Fusionné et compilé en 2.5.1 uniquement.
#5 Updated by Scrum Master almost 8 years ago
- Status changed from En cours to Résolu
#6 Updated by Lionel Morin almost 8 years ago
- Status changed from Résolu to Fermé
- Remaining (hours) changed from 0.5 to 0.0
OK :
root@amonecole:~# date jeudi 29 octobre 2015, 16:17:36 (UTC+0100) root@amonecole:~# tail -n2 /var/log/eqos.log 29/10 15:17:35 [eqosd] info : task "feedback", time not expired (30s) 29/10 15:17:35 [eqosd] info : checker is ok, continuing...