aboutsummaryrefslogtreecommitdiff
path: root/captain/log.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/log.f90')
-rw-r--r--captain/log.f909
1 files changed, 8 insertions, 1 deletions
diff --git a/captain/log.f90 b/captain/log.f90
index 44ba46e..4289f80 100644
--- a/captain/log.f90
+++ b/captain/log.f90
@@ -1,6 +1,10 @@
module logging
implicit none
+ integer, parameter::LOG_DEBUG = 8
+ integer, parameter::LOG_INFO = 6
+ integer, parameter::LOG_NORMAL = 3
+
integer, parameter::logunit = 1197
integer::level_threshold
@@ -36,6 +40,7 @@ contains
character(*), intent(in)::string
integer, intent(in), optional::level
+ character(12)::pid_text
integer::ierr
if(present(level)) then
@@ -50,8 +55,10 @@ contains
! Silently move on if we failed to open the file
if(ierr == 0) then
+ write(pid_text, '(I8)') getpid()
+
! GNU Extension... :(
- write(logunit, *) fdate()//" :: "//string
+ write(logunit, *) fdate()//" ("//trim(adjustl(pid_text))//") :: "//string
call close(logunit)
end if