@@ -34,6 +34,12 @@ The logger variables have the option to:
34
34
* indent subsequent lines of the messages; and
35
35
* format the text to fit within a maximum column width.
36
36
37
+ While every effort has been made to make the code process and
38
+ asynchronous I/O safe, it is always best to have each process write to
39
+ its own dedicated logger file.
40
+ For thread parallelism (e.g., with OpenMP), it is advised to put the
41
+ logger call in a guarding region (e.g., in an OpenMP critical region).
42
+
37
43
Note: Loggers of type ` logger_type ` normally report their messages to I/O
38
44
units in the internal list termed ` log_units ` . However if ` log_units `
39
45
is empty then the messages go to the ` output_unit ` of the intrinsic
@@ -75,14 +81,16 @@ significant events encountered during the execution of a program.
75
81
76
82
### Private attributes
77
83
78
- | Attribute | Type | Description | Initial value
79
- |------------------|---------------|-------------------------------------------------|--------------
80
- | ` add_blank_line ` | Logical | Flag to precede output with a blank line | ` .false. `
81
- | ` indent_lines ` | Logical | Flag to indent subsequent lines by four columns | ` .true. `
82
- | ` log_units ` | Integer array | List of I/O units used for output | empty
83
- | ` max_width ` | Integer | Maximum column width of output | 0
84
- | ` time_stamp ` | Logical | Flag to precede output by a time stamp | ` .true. `
85
- | ` units ` | Integer | Count of the number of active output units | 0
84
+ | Attribute | Type | Description | Initial value |
85
+ | ------------------| ---------------| -------------------------------------------------| --------------|
86
+ | ` add_blank_line ` | Logical | Flag to precede output with a blank line | ` .false. ` |
87
+ | ` buffer ` | Character(:) | Buffer to build output string | Unallocated |
88
+ | ` indent_lines ` | Logical | Flag to indent subsequent lines by four columns | ` .true. ` |
89
+ | ` len_buffer ` | Integer | Number of valid characters in buffer | 0 |
90
+ | ` log_units ` | Integer array | List of I/O units used for output | Unallocated |
91
+ | ` max_width ` | Integer | Maximum column width of output | 0 |
92
+ | ` time_stamp ` | Logical | Flag to precede output by a time stamp | ` .true. ` |
93
+ | ` units ` | Integer | Count of the number of active output units | 0 |
86
94
87
95
## The ` stdlib_logger ` variable
88
96
@@ -285,7 +293,7 @@ Pure subroutine
285
293
286
294
#### Arguments
287
295
288
- ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
296
+ ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
289
297
` intent(in) ` argument. It shall be the logger whose configuration is reported.
290
298
291
299
` add_blank_line ` (optional): shall be a scalar default logical
@@ -416,11 +424,13 @@ Subroutine
416
424
417
425
#### Arguments
418
426
419
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
420
- ` intent(in ) ` argument. It is the logger used to send the message.
427
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
428
+ ` intent(inout ) ` argument. It is the logger used to send the message.
421
429
422
430
` message ` : shall be a scalar default character expression. It is an
423
- ` intent(in) ` argument.
431
+ ` intent(in) ` argument.
432
+
433
+ * Note ` message ` may have embedded new_line calls.
424
434
425
435
` module ` (optional): shall be a scalar default character
426
436
expression. It is an ` intent(in) ` argument. It should be the name of
@@ -497,12 +507,14 @@ Subroutine
497
507
498
508
#### Arguments
499
509
500
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
501
- ` intent(in ) ` argument. It is the logger used to send the message.
510
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
511
+ ` intent(inout ) ` argument. It is the logger used to send the message.
502
512
503
513
` message ` : shall be a scalar default character expression. It is an
504
514
` intent(in) ` argument.
505
515
516
+ * Note ` message ` may have embedded new_line calls.
517
+
506
518
` module ` (optional): shall be a scalar default character
507
519
expression. It is an ` intent(in) ` argument. It should be the name of
508
520
the module containing the ` log_information ` call.
@@ -566,12 +578,14 @@ written.
566
578
Subroutine
567
579
568
580
#### Arguments
569
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
570
- ` intent(in ) ` argument. It is the logger used to send the message.
581
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
582
+ ` intent(inout ) ` argument. It is the logger used to send the message.
571
583
572
584
` message ` : shall be a scalar default character expression. It is an
573
585
` intent(in) ` argument.
574
586
587
+ * Note ` message ` may have embedded new_line calls.
588
+
575
589
` module ` (optional): shall be a scalar default character
576
590
expression. It is an ` intent(in) ` argument. It should be the name of
577
591
the module containing the ` log_io_error ` call.
@@ -642,12 +656,14 @@ Subroutine
642
656
643
657
#### Arguments
644
658
645
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
646
- ` intent(in ) ` argument. It is the logger used to send the message.
659
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
660
+ ` intent(inout ) ` argument. It is the logger used to send the message.
647
661
648
662
` message ` : shall be a scalar default character expression. It is an
649
663
` intent(in) ` argument.
650
664
665
+ * Note ` message ` may have embedded new_line calls.
666
+
651
667
` module ` (optional): shall be a scalar default character
652
668
expression. It is an ` intent(in) ` argument. It should be the name of
653
669
the module containing the ` log_message ` call.
@@ -716,8 +732,8 @@ Subroutine
716
732
717
733
#### Arguments
718
734
719
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
720
- ` intent(in ) ` argument. It is the logger used to send the message.
735
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
736
+ ` intent(inout ) ` argument. It is the logger used to send the message.
721
737
722
738
` line ` : shall be a scalar default character expression. It is an
723
739
` intent(in) ` argument. It should be the line of text in which the
@@ -862,12 +878,14 @@ Subroutine
862
878
863
879
#### Arguments
864
880
865
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
866
- ` intent(in ) ` argument. It is the logger used to send the message.
881
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
882
+ ` intent(inout ) ` argument. It is the logger used to send the message.
867
883
868
884
` message ` : shall be a scalar default character expression. It is an
869
885
` intent(in) ` argument.
870
886
887
+ * Note ` message ` may have embedded new_line calls.
888
+
871
889
` module ` : (optional) shall be a scalar default character
872
890
expression. It is an ` intent(in) ` argument. It should be the name of
873
891
the module containing the ` log_warning ` call.
@@ -925,7 +943,7 @@ Subroutine
925
943
926
944
#### Arguments
927
945
928
- ` self ` : shall be a scalar expression of type ` logger_type ` . It is an
946
+ ` self ` : shall be a scalar variable of type ` logger_type ` . It is an
929
947
` intent(inout) ` argument. It is the logger whose ` log_units ` is to be
930
948
modified.
931
949
0 commit comments