Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
def161ea
Kaydet (Commit)
def161ea
authored
Kas 29, 2013
tarafından
Andre Fischer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
123595: Logging of make_installer.pl now supports indentation.
üst
6bfb090a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
1 deletion
+71
-1
logger.pm
solenv/bin/modules/installer/logger.pm
+71
-1
No files found.
solenv/bin/modules/installer/logger.pm
Dosyayı görüntüle @
def161ea
...
...
@@ -89,6 +89,40 @@ our $Info = installer::logger->new("info",
'is_show_log_id' => 0
);
=head2 SetupSimpleLogging ($filename)
Setup logging so that $Global, $Lang and $Info all print to the console AND to the log file.
=cut
sub
SetupSimpleLogging
($)
{
my
(
$log_filename
)
=
@_
;
$Info
=
installer::
logger
->
new
(
"info"
,
'is_print_to_console'
=>
1
,
'is_show_relative_time'
=>
1
,
);
$Global
=
installer::
logger
->
new
(
"glob"
,
'is_print_to_console'
=>
0
,
'is_show_relative_time'
=>
1
,
'forward'
=>
[
$Info
]
);
$Lang
=
installer::
logger
->
new
(
"lang"
,
'is_print_to_console'
=>
0
,
'is_show_relative_time'
=>
1
,
'forward'
=>
[
$Info
]
);
$Info
->
set_filename
(
$log_filename
);
$Info
->
{
'is_print_to_console'
}
=
1
;
$
installer::globals::
quiet
=
0
;
starttime
();
}
=head2 new($class, $id, @arguments)
Create a new instance of the logger class.
...
...
@@ -119,7 +153,9 @@ sub new ($$@)
# Show log id (mostly for debugging the logger)
'is_show_log_id'
=>
0
,
# Show the process id, useful on the console when doing a multiprocessor build.
'is_show_process_id'
=>
0
'is_show_process_id'
=>
0
,
# Current indentation
'indentation'
=>
""
,
};
while
(
scalar
@arguments
>=
2
)
{
...
...
@@ -219,6 +255,7 @@ sub process_line ($$$$$$)
{
$line
.=
$pid
.
" : "
;
}
$line
.=
$self
->
{
'indentation'
};
$line
.=
$message
;
# Print the line to a file or to the console or store it for later use.
...
...
@@ -359,6 +396,24 @@ sub set_forward ($$)
sub
increase_indentation
($)
{
my
(
$self
)
=
@_
;
$self
->
{
'indentation'
}
.=
" "
;
}
sub
decrease_indentation
($)
{
my
(
$self
)
=
@_
;
$self
->
{
'indentation'
}
=
substr
(
$self
->
{
'indentation'
},
4
);
}
####################################################
# Including header files into the logfile
####################################################
...
...
@@ -637,6 +692,9 @@ sub print_error
{
my
$message
=
shift
;
chomp
$message
;
PrintError
(
$message
);
print
STDERR
"\n"
;
print
STDERR
"**************************************************\n"
;
print
STDERR
"ERROR: $message"
;
...
...
@@ -646,6 +704,18 @@ sub print_error
}
sub
PrintError
($@)
{
my
(
$format
,
@arguments
)
=
@_
;
$Info
->
printf
(
"Error: "
.
$format
,
@arguments
);
}
=head2 PrintStackTrace()
This is for debugging the print and printf methods of the logger class and their use.
Therefore we use the Perl print/printf directly and not the logger methods to avoid loops in case of errors.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment