Skip to content

Commit

Permalink
Fix to Logger for multi-byte log data
Browse files Browse the repository at this point in the history
  • Loading branch information
bpbecker committed Oct 5, 2018
1 parent a887047 commit e1040d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
12 changes: 8 additions & 4 deletions Core/MiServer.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
:Field Public TID¯1 Thread ID Server is running under
:Field Public BlockSize640000 Blocksize when returning files

:Field Public SessionHandler⎕NS ''
:Field Public Authentication⎕NS ''
:Field Public Logger⎕NS ''
:Field Public Application⎕NS ''
:Field Public SessionHandler
:Field Public Authentication
:Field Public Logger
:Field Public Application
:Field Public PageTemplates
:Field Public Encoders pointers to instances of content encoders
:Field Public Datasources
Expand Down Expand Up @@ -288,6 +288,10 @@
Make config;CongaVersion;rc;allocated;port;ports
:Access Public
:Implements Constructor
SessionHandler⎕NS''
Authentication⎕NS''
Logger⎕NS''
Application⎕NS''

SessionHandler.GetSession{} So we can always
SessionHandler.HouseKeeping{} call these fns
Expand Down
11 changes: 7 additions & 4 deletions Extensions/Logger.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
:field private EOL End Of Line

missing{0:'-' }
Char⎕DR ' '

Make ms;file;log
:Access public
Expand Down Expand Up @@ -80,11 +81,10 @@
:EndTrap

:Trap 22 file name error
TieNofn ⎕NTIE 0 34
TieNofn ⎕NTIE 0
:Else
:Trap 0
⎕NUNTIE fn ⎕NCREATE 0
TieNofn ⎕NTIE 0 34
TieNo{0 ⎕NTIE⎕NUNTIE ⎕NCREATE 0}fn
:Else
1 ##.ms.Log'Unable to open log file "',fn,'"'
:Return
Expand All @@ -93,7 +93,7 @@
r0TieNo

tryGetting{0::('-'@(' '=))(⎕DM),'-retrieving-"',,'"' }
tryGetting{0::('-'@(' '=))(⎕DM),'-retrieving-"',(),'"' }

Log req;addr;user;ts;method;page;status;msec;bytes
:Access public
Expand All @@ -118,6 +118,9 @@

ClearCache
:Hold 'Lumberjack'
:If Char⎕DR Cache
Cache('?'@{Char⎕DR¨})Cache
:EndIf
Cache ⎕NAPPEND TieNo
Cache''
:EndHold
Expand Down

0 comments on commit e1040d3

Please sign in to comment.