aboutsummaryrefslogtreecommitdiff
path: root/captain/log.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-09 08:09:20 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-09 08:09:20 -0400
commit025b5d1dcbb30e727afee3307d49328432bae603 (patch)
tree49ad0f24b7f71d9e15fbe03499b1bbaa94e6571c /captain/log.f90
parent29ab398f73c791f9591674c813c47267c524e6be (diff)
downloadlevitating-025b5d1dcbb30e727afee3307d49328432bae603.tar.gz
levitating-025b5d1dcbb30e727afee3307d49328432bae603.zip
Modified how logging works so that multiple processes can write in theory.
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