Skip to content

Commit 1ed8872

Browse files
milancurcicjvdp1
andauthored
Update doc/specs/stdlib_logger.md
Co-authored-by: Jeremie Vandenplas <jeremie.vandenplas@gmail.com>
1 parent f7ab13f commit 1ed8872

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

doc/specs/stdlib_logger.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -754,31 +754,30 @@ Subroutine
754754
#### Example
755755

756756
```fortran
757-
program example
758-
use stdlib_logger
759-
...
760-
character(*), parameter :: filename = 'dummy.txt'
761-
integer :: col_no, line_no, lun
762-
character(128) :: line
763-
character(*), parameter :: message = 'Bad text found.'
764-
765-
open( newunit=lun, file = filename, statu='old', &
757+
program demo_log_text_error
758+
use stdlib_logger
759+
760+
character(*), parameter :: filename = 'dummy.txt'
761+
integer :: col_no, line_no, lun
762+
character(128) :: line
763+
character(*), parameter :: message = 'Bad text found.'
764+
765+
open( newunit=lun, file = filename, statu='old', &
766766
form='formatted' )
767-
line_no = 0
768-
do
769-
read( lun, fmt='(a)', end=900 ) line
770-
line_no = line_no + 1
771-
call check_line( line, status, col_no )
772-
if ( status /= 0 )
773-
call global_logger % log_text_error( line, &
767+
line_no = 0
768+
do
769+
read( lun, fmt='(a)', end=900 ) line
770+
line_no = line_no + 1
771+
call check_line( line, status, col_no )
772+
if ( status /= 0 )
773+
call global_logger % log_text_error( line, &
774774
col_no, message, filename, line_no )
775-
error stop 'Error in reading ' // filename
776-
end if
777-
...
778-
end do
775+
error stop 'Error in reading ' // filename
776+
end if
777+
end do
779778
900 continue
780-
...
781-
end program example
779+
780+
end program demo_log_text_error
782781
```
783782

784783
### `log_units_assigned` - returns the number of active I/O units

0 commit comments

Comments
 (0)