Skip to content

Commit

Permalink
Save logs to /tmp/i-nex.log
Browse files Browse the repository at this point in the history
  • Loading branch information
eloaders committed Jan 5, 2014
1 parent a8ca993 commit 7ebe7a6
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
54 changes: 27 additions & 27 deletions src/i-nex/.src/Finfosys.form
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
}
}
{ HBox11 HBox
Move(119,497,154,28)
Move(119,497,182,28)
{ Label25 Label
Move(14,0,48,24)
Foreground = &HFF0000&
Expand Down Expand Up @@ -412,14 +412,14 @@
Stretch = True
}
{ Label105 Label
Move(7,343,455,21)
Move(7,280,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Border = Border.Raised
}
{ Label107 Label
Move(7,385,455,21)
Move(7,322,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Expand All @@ -433,7 +433,7 @@
Border = Border.Raised
}
{ Label106 Label
Move(7,364,455,21)
Move(7,301,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Expand All @@ -445,14 +445,6 @@
Font = Font["Bold,8"]
Border = Border.Raised
}
{ Label64 Label
Move(7,301,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Text = "Label64"
Border = Border.Raised
}
{ TextBox1 TextBox
Move(7,252,455,28)
#Translate = False
Expand Down Expand Up @@ -515,21 +507,6 @@
Text = "Label102"
Border = Border.Raised
}
{ Label146 Label
Move(7,322,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Text = "Label146"
Border = Border.Raised
}
{ Label136 Label
Move(7,280,455,21)
Font = Font["Bold,8"]
Padding = 3
Text = ("Label136")
Border = Border.Raised
}
{ Label154 Label
Move(7,189,455,21)
Font = Font["Bold,8"]
Expand Down Expand Up @@ -558,6 +535,29 @@
Text = ("Force")
Picture = Picture["icon:/16/make"]
}
{ Label136 Label
Move(7,343,455,21)
Font = Font["Bold,8"]
Padding = 3
Text = ("Label136")
Border = Border.Raised
}
{ Label64 Label
Move(7,364,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Text = "Label64"
Border = Border.Raised
}
{ Label146 Label
Move(7,385,455,21)
#Translate = False
Font = Font["Bold,8"]
Padding = 3
Text = "Label146"
Border = Border.Raised
}
Index = 2
Text = ("Mobo")
{ Frame1 Frame
Expand Down
9 changes: 6 additions & 3 deletions src/i-nex/.src/Logger.class
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
' Gambas class file

Create Static

Public inexlog As String
Property Level As Integer
Property Format As String

Expand Down Expand Up @@ -49,6 +49,7 @@ Public Sub _call(sMessage As String, Optional iLevel As Integer = Logger.Info)

sMessage = Formatter(sMessage, $sFormat, iLevel)


_Write(sMessage)

End
Expand All @@ -69,10 +70,13 @@ Private Sub _Write(sLine As String)

If $sOutput = ":stdout" Then
Print sLine
If Access("/tmp/", gb.Write) = True Then
Shell "echo '" & sLine & "' >>/tmp" &/ Application.Name & ".log"
Endif
Else
Print #$sLogFile, sLine
Endif

End

Private Sub _OpenLog()
Expand All @@ -82,7 +86,6 @@ Private Sub _OpenLog()
Endif

If Not Access(File.Dir($sOutput), gb.Write) Then Error.Raise(("Log file not writable"))

If Exist($sOutput) Then
$sLogFile = Open $sOutput For Write Append
Else
Expand Down

0 comments on commit 7ebe7a6

Please sign in to comment.