source upload

This commit is contained in:
Razor12911
2022-01-17 22:16:47 +02:00
parent 12936d065b
commit 098e8c48de
1778 changed files with 1206749 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
program LibraryTest;
{$APPTYPE CONSOLE}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
SysUtils;
procedure Test; external 'MyLibrary.dll';
begin
Test;
end.

View File

@@ -0,0 +1,26 @@
/// sample program able to visualize .log files as created by TSynLog
program LogView;
{ Revision History:
Version 1.18
- Introducing thread identification
- Added "Search Previous" button
- Incremental search will now remain on the same line if it matches the entry
- "Server Launch" button allow the tool to run as a HTTP server, ready to
display remote logs, echoed from mORMot HTTP clients
}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
Forms,
LogViewMain in 'LogViewMain.pas' {MainLogView};
{$R *.res}
{$R Vista.res}
begin
Application.Initialize;
Application.CreateForm(TMainLogView, MainLogView);
Application.Run;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="LogView"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<BuildModes Count="4">
<Item1 Name="Default" Default="True"/>
<Item2 Name="win64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="exe\LogView"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\..\.."/>
<OtherUnitFiles Value="..\..\..;..\.."/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="win64"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item2>
<Item3 Name="linux64">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\..\.."/>
<OtherUnitFiles Value="..\..\..;..\.."/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="x86_64"/>
<TargetOS Value="linux"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item3>
<Item4 Name="darwin32">
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\..\.."/>
<OtherUnitFiles Value="..\..\..;..\.."/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
<TargetCPU Value="i386"/>
<TargetOS Value="darwin"/>
<Optimizations>
<OptimizationLevel Value="3"/>
</Optimizations>
</CodeGeneration>
<Linking>
<Debugging>
<GenerateDebugInfo Value="False"/>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
</Item4>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="1">
<Mode0 Name="default"/>
</Modes>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="3">
<Unit0>
<Filename Value="LogView.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="LogViewMain.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="MainLogView"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
<Unit2>
<Filename Value="..\ThirdPartyDemos\Ondrej\SynTaskDialog4Lazarus\SynTaskDialog.pas"/>
<IsPartOfProject Value="True"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="exe\LogView"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir);..\..\.."/>
<OtherUnitFiles Value="..\..\..;..\.."/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="5">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
<Item4>
<Name Value="EHttpApiServer"/>
</Item4>
<Item5>
<Name Value="EHttpServerException"/>
</Item5>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,19 @@
program LogView;
{$mode objfpc}{$H+}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
Interfaces, // this includes the LCL widgetset
Forms,
SynTaskDialog in '..\..\Samples\ThirdPartyDemos\Ondrej\SynTaskDialog4Lazarus\SynTaskDialog.pas',
LogViewMain in 'LogViewMain.pas' {MainLogView};
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Initialize;
Application.CreateForm(TMainLogView, MainLogView);
Application.Run;
end.

View File

@@ -0,0 +1,588 @@
object MainLogView: TMainLogView
Left = 359
Top = 232
Width = 860
Height = 639
Caption = ' Synopse LogView %s -'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
KeyPreview = True
OldCreateOrder = False
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object Splitter2: TSplitter
Left = 0
Top = 549
Width = 852
Height = 4
Cursor = crVSplit
Align = alBottom
end
object Splitter3: TSplitter
Left = 805
Top = 0
Width = 4
Height = 549
Visible = False
end
object Splitter1: TSplitter
Left = 649
Top = 0
Width = 4
Height = 549
Visible = False
end
object Splitter4: TSplitter
Left = 801
Top = 0
Width = 4
Height = 549
Visible = False
end
object PanelLeft: TPanel
Left = 225
Top = 0
Width = 150
Height = 549
Align = alLeft
Constraints.MinWidth = 150
TabOrder = 0
OnResize = PanelLeftResize
DesignSize = (
150
549)
object ImageLogo: TImage
Left = 8
Top = 501
Width = 137
Height = 32
Anchors = [akLeft, akRight, akBottom]
Center = True
Picture.Data = {
07544269746D617076090000424D760900000000000076000000280000008900
0000200000000100040000000000000900000000000000000000100000000000
00000504180004A6FC00444446000704C400918FB000D1D1DF001D26E0005454
5600726FA000046EFC00B2B0CD0031323300FCFEFC005A53D1003731CF004446
FC00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC555A5555CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCC54444CCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCA77778777785CCCCCCCCCCCCC5444ACCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCC533338C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC58274A555555A877ACCCCCCCCCCCD3333
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCC63333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA774A472BBBB74AA82
4CCCCCCCCCCD3333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000CCCCCCCCCCCCCCCCCCCCCCA3333ACCCCCCCCCCCCCCCCCCCCCCCCCCCCC428
4700000000000244775CCCCCCCCD3333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCC3333ECCCCCCCCCCCCCCCC
CCCCCCCCCCCC4278B0000000000000078775CCCCCCCD3336CCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCC54E3333EACCCCCCCCC83333
CCCCCCCC888D5CCCC488DACCCCC4277000000000000000002727CCCCCCCD3336
CD63E4CCCCCCCAF333368CCCCCCCCC5863333FACCCCCC0000000CCCC83333333
3334CCCCCCCE3333DCCCCCCC3333ACCCC3333FCCCCA277000000000000000000
0B728CCCCCCD333333333365CCC53333333333FCCCCC5E3333333333ACCCC000
0000CCCCD333333333334CCCCC5333333CCCCCCC3333ACCCC6333DCCCC748000
000033333333000000287ACCCCCD333333333333CCC533333333333ECCC53333
33333333ACCCC0000000CCCCD3EACCCC83333CCCCCD3333334CCCCCC3333ACCC
C6333DCCC48AB0000033333333333000000847CCCCCD33335AAD3333DCC53345
CCCA33335CC333338A5C5463ACCCC0000000CCCC4ACCCCCC43333CCCCC333333
36CCCCCC3333ACCCC6333DCCC7AA000003333333333333000002A75CCCCD3336
CCCCD33335C58CCCCCC533334CA3333ACCCCCCC85CCCC0000000CCCCCCC5A8E3
33333CCCCA3333E3335CCCCC3333ACCCC6333DCC5BA700003333333333333330
0000587CCCCD3333CCCC53333ACCCCCA8F333333AC8333FCCCCCCCCCCCCCC000
0000CCCCCCD333333333FCCCC63338A333DCCCCC3333ACCCC6333DCC42400000
33333333333333330000442CCCCD3333CCCCC33334CCC43333333333CCD3333F
EEEEEEE68CCCC0000000CCCCC3333333333DCCCC533335C3333CCCCC3333ACCC
C6333DCC227000033333333333333333000028B5CCCD3333CCCCC33338CC8333
33333335CCD3333333333333FCCCC0000000CCCC53333333E45CCCCC83336CCE
3334CCCC3333ACCCC3333DCCB77000033333333333333333000008B5CCCD3333
CCCCC33334CC33333336D5CCCCD3333333333333DCCCC0000000CCCC43333ACC
CCCCCCCC33334CCA3333CCCC3333ACCCC3333DCC07B000033333336193333333
000007BACCCD3336CCCCA3333ACC33338CCCCCC5CCA333DCCCCC63334CCCC000
0000CCCCA3333CCCCC538CCA3333CCCC33335CCC333338AAF33334CC07B00003
3333336193333333000007BACCCD3333ACC5333335CC3333ACCCC5D3CCC33335
CCCC33335CCCC0000000CCCCC333333633334CC3333ECCCCD3336CCC33333333
333335CC077000033333633333333333000007BACCCD333333333333DCCCD333
33633333CCCA3333F4D3333FCCCCC0000000CCCCC533333333338C53333ACCCC
A3333CCC3333F3333333FCCCB7700B03333F6333336663330000B8B5CCCD3333
63333333CCCCCE3333333333CCCC43333333333CCCCCC0000000CCCCCCC46333
3368CC4366ECCCCCCE6634CCE6635CD33338CCCC828004003333333333336333
00B077BCCCC8366DC83333DCCCCCCCAE333333FACCCCCCD3333338CCCCCCC000
0000CCCCCCCCCC555CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC55CCCCCC5B4B0A20
DD3333EFF333336B0040872CCCCCCCCCCCC55CCCCCCCCCCCCC55CCCCCCCCCCCC
5555CCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCC7440BB00333333333333372088B42ACCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCA4AB00000333EEEEE3330000B0847CCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4440000000384A48300000
007445CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC574800
000B0000000BB0000244ACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCC474400085555555554B007487CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCC72A4B0028A5C5A470008A825CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC77AA8000000000007AA
8B5CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA7
4A5A8BB0BB7455478CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCC5474A55555555487ACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA44AAAAA4445CCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC555555CCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000}
Transparent = True
OnClick = ImageLogoClick
end
object lblServerRoot: TLabel
Left = 16
Top = 48
Width = 62
Height = 13
Caption = 'Server Root:'
end
object lblServerPort: TLabel
Left = 16
Top = 90
Width = 59
Height = 13
Caption = 'Server Port:'
end
object BtnBrowse: TButton
Left = 16
Top = 8
Width = 107
Height = 25
Anchors = [akTop, akRight]
Caption = 'Select File'
TabOrder = 0
OnClick = BtnBrowseClick
end
object EventsList: TCheckListBox
Left = 16
Top = 72
Width = 118
Height = 105
Hint = 'Selection of Events - right click for shortcuts'
OnClickCheck = EventsListClickCheck
ItemHeight = 13
ParentShowHint = False
PopupMenu = FilterMenu
ShowHint = True
Style = lbOwnerDrawFixed
TabOrder = 3
OnDblClick = EventsListDblClick
OnDrawItem = EventsListDrawItem
end
object EditSearch: TEdit
Left = 16
Top = 40
Width = 85
Height = 21
Hint = 'Search (Ctrl+F, F3 for next) '
Anchors = [akLeft, akTop, akRight]
ParentShowHint = False
ShowHint = True
TabOrder = 1
OnChange = BtnSearchNextClick
end
object BtnSearchNext: TButton
Left = 105
Top = 38
Width = 20
Height = 23
Hint = 'Search Next (F3)'
Anchors = [akTop, akRight]
Caption = '?'
ParentShowHint = False
ShowHint = True
TabOrder = 2
OnClick = BtnSearchNextClick
end
object BtnStats: TButton
Left = 16
Top = 304
Width = 57
Height = 25
Caption = 'Stats'
TabOrder = 6
OnClick = BtnStatsClick
end
object BtnMapSearch: TButton
Left = 80
Top = 304
Width = 59
Height = 25
Hint = 'Search for an address in a .map file'
Caption = '.map'
ParentShowHint = False
ShowHint = True
TabOrder = 7
OnClick = BtnMapSearchClick
end
object MergedProfile: TCheckBox
Left = 22
Top = 283
Width = 121
Height = 17
Caption = 'Merge method calls'
TabOrder = 5
OnClick = MergedProfileClick
end
object ProfileGroup: TRadioGroup
Left = 16
Top = 192
Width = 118
Height = 89
Caption = ' Methods profiler '
ParentShowHint = False
ShowHint = False
TabOrder = 4
OnClick = ProfileGroupClick
end
object ThreadGroup: TGroupBox
Left = 16
Top = 336
Width = 118
Height = 97
Caption = ' Threads '
TabOrder = 8
object BtnThreadNext: TButton
Left = 8
Top = 13
Width = 33
Height = 25
Hint = 'Goto Next Thread'
Caption = 'Next'
ParentShowHint = False
ShowHint = True
TabOrder = 0
OnClick = BtnThreadNextClick
end
object BtnThreadShow: TButton
Left = 8
Top = 39
Width = 97
Height = 25
Caption = 'View threads'
TabOrder = 1
OnClick = BtnThreadShowClick
end
object btnThread0: TButton
Left = 8
Top = 66
Width = 25
Height = 25
Hint = 'Select No Thread'
Caption = '0'
Enabled = False
ParentShowHint = False
ShowHint = True
TabOrder = 2
OnClick = BtnThreadClick
end
object btnThread1: TButton
Left = 40
Top = 66
Width = 25
Height = 25
Hint = 'Select Only This Thread'
Caption = '1'
Enabled = False
ParentShowHint = False
ShowHint = True
TabOrder = 3
OnClick = BtnThreadClick
end
object btnThreadAll: TButton
Left = 72
Top = 66
Width = 33
Height = 25
Hint = 'Select All Threads'
Caption = 'All'
Enabled = False
ParentShowHint = False
ShowHint = True
TabOrder = 4
OnClick = BtnThreadClick
end
object btnThreadDown: TButton
Left = 56
Top = 13
Width = 25
Height = 25
Hint = 'Goto Next Row'
Caption = 'v'
ParentShowHint = False
ShowHint = True
TabOrder = 5
OnClick = btnThreadDownClick
end
object btnThreadUp: TButton
Left = 80
Top = 13
Width = 25
Height = 25
Hint = 'Goto Previous Row'
Caption = '^'
ParentShowHint = False
ShowHint = True
TabOrder = 6
OnClick = btnThreadUpClick
end
end
object BtnSearchPrevious: TButton
Left = 127
Top = 38
Width = 20
Height = 23
Hint = 'Search Previous (Shift F3)'
Anchors = [akTop, akRight]
Caption = '^'
ParentShowHint = False
ShowHint = True
TabOrder = 9
OnClick = BtnSearchNextClick
end
object btnServerLaunch: TButton
Left = 16
Top = 132
Width = 107
Height = 25
Hint = 'Lauch a HTTP server for remote logging'
Anchors = [akTop, akRight]
Caption = 'Server Launch'
ParentShowHint = False
ShowHint = True
TabOrder = 10
OnClick = btnServerLaunchClick
end
object edtServerRoot: TEdit
Left = 16
Top = 64
Width = 121
Height = 21
TabOrder = 11
Text = 'LogService'
end
object edtServerPort: TEdit
Left = 16
Top = 106
Width = 121
Height = 21
TabOrder = 12
Text = '8091'
end
object btnListClear: TButton
Left = 16
Top = 160
Width = 105
Height = 25
Caption = 'Clear List'
TabOrder = 13
Visible = False
OnClick = btnListClearClick
end
object btnListSave: TButton
Left = 16
Top = 192
Width = 105
Height = 25
Caption = 'Save List'
TabOrder = 14
Visible = False
OnClick = btnListSaveClick
end
object lstDays: TListBox
Left = 16
Top = 440
Width = 121
Height = 57
ItemHeight = 13
TabOrder = 15
OnDblClick = lstDaysDblClick
end
end
object PanelBottom: TPanel
Left = 0
Top = 553
Width = 852
Height = 52
Align = alBottom
TabOrder = 3
OnResize = PanelBottomResize
end
object List: TDrawGrid
Left = 809
Top = 0
Width = 43
Height = 549
Align = alClient
ColCount = 3
DefaultColWidth = 100
DefaultRowHeight = 14
FixedCols = 0
RowCount = 1
FixedRows = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goRowSelect, goThumbTracking]
PopupMenu = ListMenu
TabOrder = 2
Visible = False
OnClick = ListClick
OnDblClick = ListDblClick
OnDrawCell = ListDrawCell
end
object ProfileList: TDrawGrid
Left = 375
Top = 0
Width = 274
Height = 549
Align = alLeft
ColCount = 2
DefaultColWidth = 100
DefaultRowHeight = 14
FixedCols = 0
FixedRows = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSelect, goThumbTracking]
TabOrder = 1
Visible = False
OnClick = ProfileListClick
OnDrawCell = ProfileListDrawCell
end
object PanelThread: TPanel
Left = 653
Top = 0
Width = 148
Height = 549
Align = alLeft
TabOrder = 4
Visible = False
object ThreadListBox: TCheckListBox
Left = 1
Top = 1
Width = 146
Height = 507
OnClickCheck = ThreadListBoxClickCheck
Align = alClient
ItemHeight = 13
TabOrder = 0
OnClick = ThreadListBoxClick
OnDblClick = ThreadListBoxDblClick
end
object pnlThreadBottom: TPanel
Left = 1
Top = 508
Width = 146
Height = 40
Align = alBottom
TabOrder = 1
DesignSize = (
146
40)
object lblThreadName: TLabel
Left = 3
Top = 3
Width = 141
Height = 33
Anchors = [akLeft, akTop, akRight, akBottom]
AutoSize = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
WordWrap = True
end
end
end
object PanelBrowse: TPanel
Left = 0
Top = 0
Width = 225
Height = 549
Align = alLeft
Constraints.MinWidth = 80
TabOrder = 5
Visible = False
DesignSize = (
225
549)
object Drive: TDriveComboBox
Left = 8
Top = 8
Width = 210
Height = 19
Anchors = [akLeft, akTop, akRight]
DirList = Directory
TabOrder = 0
end
object Directory: TDirectoryListBox
Left = 8
Top = 33
Width = 210
Height = 220
Anchors = [akLeft, akTop, akRight]
FileList = Files
ItemHeight = 16
TabOrder = 1
end
object Files: TFileListBox
Left = 8
Top = 264
Width = 210
Height = 268
Anchors = [akLeft, akTop, akRight, akBottom]
ItemHeight = 13
Mask = '*.log;*.synlz;*.txt'
TabOrder = 2
OnClick = FilesClick
end
end
object FilterMenu: TPopupMenu
Left = 320
Top = 136
end
object OpenDialog: TOpenDialog
DefaultExt = '.log'
Filter = 'Log|*.log;*.txt;*.synlz'
Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing]
Left = 344
Top = 72
end
object ListMenu: TPopupMenu
Left = 816
Top = 120
object ListMenuCopy: TMenuItem
Caption = '&Copy'
OnClick = ListMenuCopyClick
end
end
object tmrRefresh: TTimer
Enabled = False
Interval = 200
OnTimer = tmrRefreshTimer
Left = 345
Top = 336
end
object dlgSaveList: TSaveDialog
DefaultExt = '.log'
Filter = 'log|*.log|txt|*.txt|synlz|*.synlz'
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Left = 345
Top = 200
end
end

View File

@@ -0,0 +1,584 @@
object MainLogView: TMainLogView
Left = 454
Height = 639
Top = 95
Width = 860
Caption = ' Synopse LogView %s -'
ClientHeight = 639
ClientWidth = 860
Color = clBtnFace
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
KeyPreview = True
OnCreate = FormCreate
OnKeyDown = FormKeyDown
OnShow = FormShow
LCLVersion = '2.0.8.0'
object Splitter2: TSplitter
Cursor = crVSplit
Left = 0
Height = 4
Top = 635
Width = 860
Align = alBottom
ResizeAnchor = akBottom
end
object Splitter3: TSplitter
Left = 837
Height = 635
Top = 0
Width = 4
Visible = False
end
object Splitter1: TSplitter
Left = 829
Height = 635
Top = 0
Width = 4
Visible = False
end
object Splitter4: TSplitter
Left = 833
Height = 635
Top = 0
Width = 4
Visible = False
end
object PanelLeft: TPanel
Left = 257
Height = 635
Top = 0
Width = 150
Align = alLeft
ClientHeight = 635
ClientWidth = 150
Constraints.MinWidth = 150
TabOrder = 0
object ImageLogo: TImage
Left = 8
Height = 32
Top = 591
Width = 137
Anchors = [akLeft, akRight, akBottom]
Center = True
OnClick = ImageLogoClick
Picture.Data = {
07544269746D617076090000424D760900000000000076000000280000008900
0000200000000100040000000000000900000000000000000000100000000000
00000504180004A6FC00444446000704C400918FB000D1D1DF001D26E0005454
5600726FA000046EFC00B2B0CD0031323300FCFEFC005A53D1003731CF004446
FC00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCC555A5555CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCC54444CCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCA77778777785CCCCCCCCCCCCC5444ACCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCC533338C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC58274A555555A877ACCCCCCCCCCCD3333
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCC63333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA774A472BBBB74AA82
4CCCCCCCCCCD3333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000CCCCCCCCCCCCCCCCCCCCCCA3333ACCCCCCCCCCCCCCCCCCCCCCCCCCCCC428
4700000000000244775CCCCCCCCD3333CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCC3333ECCCCCCCCCCCCCCCC
CCCCCCCCCCCC4278B0000000000000078775CCCCCCCD3336CCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCC54E3333EACCCCCCCCC83333
CCCCCCCC888D5CCCC488DACCCCC4277000000000000000002727CCCCCCCD3336
CD63E4CCCCCCCAF333368CCCCCCCCC5863333FACCCCCC0000000CCCC83333333
3334CCCCCCCE3333DCCCCCCC3333ACCCC3333FCCCCA277000000000000000000
0B728CCCCCCD333333333365CCC53333333333FCCCCC5E3333333333ACCCC000
0000CCCCD333333333334CCCCC5333333CCCCCCC3333ACCCC6333DCCCC748000
000033333333000000287ACCCCCD333333333333CCC533333333333ECCC53333
33333333ACCCC0000000CCCCD3EACCCC83333CCCCCD3333334CCCCCC3333ACCC
C6333DCCC48AB0000033333333333000000847CCCCCD33335AAD3333DCC53345
CCCA33335CC333338A5C5463ACCCC0000000CCCC4ACCCCCC43333CCCCC333333
36CCCCCC3333ACCCC6333DCCC7AA000003333333333333000002A75CCCCD3336
CCCCD33335C58CCCCCC533334CA3333ACCCCCCC85CCCC0000000CCCCCCC5A8E3
33333CCCCA3333E3335CCCCC3333ACCCC6333DCC5BA700003333333333333330
0000587CCCCD3333CCCC53333ACCCCCA8F333333AC8333FCCCCCCCCCCCCCC000
0000CCCCCCD333333333FCCCC63338A333DCCCCC3333ACCCC6333DCC42400000
33333333333333330000442CCCCD3333CCCCC33334CCC43333333333CCD3333F
EEEEEEE68CCCC0000000CCCCC3333333333DCCCC533335C3333CCCCC3333ACCC
C6333DCC227000033333333333333333000028B5CCCD3333CCCCC33338CC8333
33333335CCD3333333333333FCCCC0000000CCCC53333333E45CCCCC83336CCE
3334CCCC3333ACCCC3333DCCB77000033333333333333333000008B5CCCD3333
CCCCC33334CC33333336D5CCCCD3333333333333DCCCC0000000CCCC43333ACC
CCCCCCCC33334CCA3333CCCC3333ACCCC3333DCC07B000033333336193333333
000007BACCCD3336CCCCA3333ACC33338CCCCCC5CCA333DCCCCC63334CCCC000
0000CCCCA3333CCCCC538CCA3333CCCC33335CCC333338AAF33334CC07B00003
3333336193333333000007BACCCD3333ACC5333335CC3333ACCCC5D3CCC33335
CCCC33335CCCC0000000CCCCC333333633334CC3333ECCCCD3336CCC33333333
333335CC077000033333633333333333000007BACCCD333333333333DCCCD333
33633333CCCA3333F4D3333FCCCCC0000000CCCCC533333333338C53333ACCCC
A3333CCC3333F3333333FCCCB7700B03333F6333336663330000B8B5CCCD3333
63333333CCCCCE3333333333CCCC43333333333CCCCCC0000000CCCCCCC46333
3368CC4366ECCCCCCE6634CCE6635CD33338CCCC828004003333333333336333
00B077BCCCC8366DC83333DCCCCCCCAE333333FACCCCCCD3333338CCCCCCC000
0000CCCCCCCCCC555CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC55CCCCCC5B4B0A20
DD3333EFF333336B0040872CCCCCCCCCCCC55CCCCCCCCCCCCC55CCCCCCCCCCCC
5555CCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCC7440BB00333333333333372088B42ACCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCA4AB00000333EEEEE3330000B0847CCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC4440000000384A48300000
007445CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC574800
000B0000000BB0000244ACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCC474400085555555554B007487CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCC72A4B0028A5C5A470008A825CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC77AA8000000000007AA
8B5CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA7
4A5A8BB0BB7455478CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCC5474A55555555487ACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCA44AAAAA4445CCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0000000CCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC555555CCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000
0000
}
Transparent = True
end
object lblServerRoot: TLabel
Left = 16
Height = 12
Top = 48
Width = 70
Caption = 'Server Root:'
ParentColor = False
end
object lblServerPort: TLabel
Left = 16
Height = 12
Top = 90
Width = 67
Caption = 'Server Port:'
ParentColor = False
end
object BtnBrowse: TButton
Left = 16
Height = 25
Top = 8
Width = 107
Anchors = [akTop, akRight]
Caption = 'Select File'
OnClick = BtnBrowseClick
TabOrder = 0
end
object EventsList: TCheckListBox
Left = 16
Height = 105
Top = 72
Width = 118
ItemHeight = 13
OnClickCheck = EventsListClickCheck
OnDblClick = EventsListDblClick
OnDrawItem = EventsListDrawItem
PopupMenu = FilterMenu
Style = lbOwnerDrawFixed
TabOrder = 3
TopIndex = -1
end
object EditSearch: TEdit
Left = 16
Height = 30
Hint = 'Search (Ctrl+F, F3 for next) '
Top = 40
Width = 85
Anchors = [akTop, akLeft, akRight]
OnChange = BtnSearchNextClick
ParentShowHint = False
ShowHint = True
TabOrder = 1
end
object BtnSearchNext: TButton
Left = 105
Height = 21
Hint = 'Search Next (F3)'
Top = 40
Width = 20
Anchors = [akTop, akRight]
Caption = 'v'
OnClick = BtnSearchNextClick
ParentShowHint = False
ShowHint = True
TabOrder = 2
end
object BtnStats: TButton
Left = 16
Height = 25
Top = 304
Width = 57
Caption = 'Stats'
OnClick = BtnStatsClick
TabOrder = 6
end
object BtnMapSearch: TButton
Left = 80
Height = 25
Hint = 'Search for an address in a .map file'
Top = 304
Width = 59
Caption = '.map'
OnClick = BtnMapSearchClick
ParentShowHint = False
ShowHint = True
TabOrder = 7
end
object MergedProfile: TCheckBox
Left = 22
Height = 23
Top = 283
Width = 134
Caption = 'Merge method calls'
OnClick = MergedProfileClick
TabOrder = 5
end
object ProfileGroup: TRadioGroup
Left = 16
Height = 89
Top = 192
Width = 118
AutoFill = True
Caption = ' Methods profiler '
ChildSizing.LeftRightSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
OnClick = ProfileGroupClick
TabOrder = 4
end
object ThreadGroup: TGroupBox
Left = 16
Height = 96
Top = 336
Width = 118
Caption = ' Threads '
ClientHeight = 81
ClientWidth = 116
TabOrder = 8
object BtnThreadNext: TButton
Left = 8
Height = 25
Top = 0
Width = 41
Caption = 'Next'
OnClick = BtnThreadNextClick
TabOrder = 0
end
object BtnThreadShow: TButton
Left = 8
Height = 25
Top = 24
Width = 97
Caption = 'View threads'
OnClick = BtnThreadShowClick
TabOrder = 1
end
object btnThread0: TButton
Left = 8
Height = 25
Hint = 'Select No Thread'
Top = 48
Width = 25
Caption = '0'
Enabled = False
OnClick = BtnThreadClick
ParentShowHint = False
ShowHint = True
TabOrder = 2
end
object btnThread1: TButton
Left = 40
Height = 25
Hint = 'Select Only This Thread'
Top = 48
Width = 25
Caption = '1'
Enabled = False
OnClick = BtnThreadClick
ParentShowHint = False
ShowHint = True
TabOrder = 3
end
object btnThreadAll: TButton
Left = 72
Height = 25
Hint = 'Select All Threads'
Top = 48
Width = 33
Caption = 'All'
Enabled = False
OnClick = BtnThreadClick
ParentShowHint = False
ShowHint = True
TabOrder = 4
end
object btnThreadDown: TButton
Left = 56
Height = 25
Hint = 'Goto Next Row'
Top = 0
Width = 25
Caption = 'v'
OnClick = btnThreadDownClick
ParentShowHint = False
ShowHint = True
TabOrder = 5
end
object btnThreadUp: TButton
Left = 80
Height = 25
Hint = 'Goto Previous Row'
Top = 0
Width = 25
Caption = '^'
OnClick = btnThreadUpClick
ParentShowHint = False
ShowHint = True
TabOrder = 6
end
end
object BtnSearchPrevious: TButton
Left = 125
Height = 21
Hint = 'Search Previous (Shift F3)'
Top = 40
Width = 20
Anchors = [akTop, akRight]
Caption = '^'
OnClick = BtnSearchNextClick
ParentShowHint = False
ShowHint = True
TabOrder = 9
end
object btnServerLaunch: TButton
Left = 16
Height = 25
Hint = 'Lauch a HTTP server for remote logging'
Top = 132
Width = 107
Anchors = [akTop, akRight]
Caption = 'Server Launch'
OnClick = btnServerLaunchClick
ParentShowHint = False
ShowHint = True
TabOrder = 10
end
object edtServerRoot: TEdit
Left = 16
Height = 30
Top = 64
Width = 121
TabOrder = 11
Text = 'LogService'
end
object edtServerPort: TEdit
Left = 16
Height = 30
Top = 106
Width = 121
TabOrder = 12
Text = '8091'
end
object btnListClear: TButton
Left = 16
Height = 25
Top = 160
Width = 105
Caption = 'Clear List'
OnClick = btnListClearClick
TabOrder = 13
Visible = False
end
object btnListSave: TButton
Left = 16
Height = 25
Top = 192
Width = 105
Caption = 'Save List'
OnClick = btnListSaveClick
TabOrder = 14
Visible = False
end
object lstDays: TListBox
Left = 16
Height = 57
Top = 440
Width = 121
ItemHeight = 0
OnDblClick = lstDaysDblClick
ScrollWidth = 119
TabOrder = 15
TopIndex = -1
end
end
object List: TDrawGrid
Left = 841
Height = 635
Top = 0
Width = 19
Align = alClient
ColCount = 3
DefaultColWidth = 100
DefaultRowHeight = 14
ExtendedSelect = False
FixedCols = 0
FixedRows = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goDrawFocusSelected, goRowSelect, goThumbTracking]
PopupMenu = ListMenu
RowCount = 1
TabOrder = 2
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'Tahoma'
Visible = False
OnClick = ListClick
OnDblClick = ListDblClick
OnDrawCell = ListDrawCell
end
object ProfileList: TDrawGrid
Left = 407
Height = 635
Top = 0
Width = 274
Align = alLeft
ColCount = 2
DefaultColWidth = 100
DefaultRowHeight = 14
ExtendedSelect = False
FixedCols = 0
FixedRows = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goRowSelect, goThumbTracking]
TabOrder = 1
TitleFont.Color = clWindowText
TitleFont.Height = -11
TitleFont.Name = 'Tahoma'
Visible = False
OnClick = ProfileListClick
OnDrawCell = ProfileListDrawCell
end
object PanelThread: TPanel
Left = 681
Height = 635
Top = 0
Width = 148
Align = alLeft
ClientHeight = 635
ClientWidth = 148
TabOrder = 3
Visible = False
object ThreadListBox: TCheckListBox
Left = 1
Height = 593
Top = 1
Width = 146
Align = alClient
ItemHeight = 0
OnClick = ThreadListBoxClick
OnClickCheck = ThreadListBoxClickCheck
OnDblClick = ThreadListBoxDblClick
TabOrder = 0
TopIndex = -1
end
object pnlThreadBottom: TPanel
Left = 1
Height = 40
Top = 594
Width = 146
Align = alBottom
ClientHeight = 40
ClientWidth = 146
TabOrder = 1
object lblThreadName: TLabel
Left = 3
Height = 33
Top = 3
Width = 141
Anchors = [akTop, akLeft, akRight, akBottom]
ParentColor = False
ParentFont = False
WordWrap = True
end
end
end
object PanelBrowse: TPanel
Left = 0
Height = 635
Top = 0
Width = 257
Align = alLeft
ClientHeight = 635
ClientWidth = 257
Constraints.MinWidth = 80
TabOrder = 4
Visible = False
object Directory: TShellTreeView
Left = 8
Height = 344
Top = 8
Width = 240
FileSortType = fstNone
HideSelection = False
ReadOnly = True
TabOrder = 0
Options = [tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
ObjectTypes = [otFolders]
ShellListView = Files
end
object Files: TShellListView
Left = 8
Height = 207
Top = 368
Width = 240
Color = clDefault
HideSelection = False
ReadOnly = True
TabOrder = 1
OnClick = FilesClick
ObjectTypes = [otNonFolders]
ShellTreeView = Directory
end
end
object FilterMenu: TPopupMenu
Left = 88
Top = 16
end
object OpenDialog: TOpenDialog
DefaultExt = '.log'
Filter = 'Log|*.log;*.txt;*.synlz'
Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing]
Left = 40
Top = 80
end
object ListMenu: TPopupMenu
Left = 40
Top = 16
object ListMenuCopy: TMenuItem
Caption = '&Copy'
OnClick = ListMenuCopyClick
end
end
object tmrRefresh: TTimer
Enabled = False
Interval = 200
OnTimer = tmrRefreshTimer
Left = 88
Top = 80
end
object dlgSaveList: TSaveDialog
DefaultExt = '.log'
Filter = 'log|*.log|txt|*.txt|synlz|*.synlz'
Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
Left = 136
Top = 16
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,251 @@
{
Synopse mORMot framework
Sample 11 - Exception logging
purpose of this sample is to show basic logging mechanism of the framework
TO HAVE LINE NUMBERS IN THE LOG FILE:
- Go to Project/Options then set the Linker/File map setting to "Detailed"
Version 1.0 - April 14, 2011
- Initial Release
Version 1.18
- Kylix support
}
program LoggingTest;
{$AppType console}
{$I Synopse.inc} // all expected conditionals
{$ifndef DELPHI5OROLDER} // mORMot.pas doesn't compile under Delphi 5
{$define WITHMORMOT}
{$endif}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
{$ifdef MSWINDOWS}
Windows,
ComObj,
{$endif}
SysUtils,
{$ifdef WITHMORMOT}
mORMot,
{$endif}
SynCommons,
SynLog;
type
/// a class just to show how methods are handled
TTestLogClass = class
protected
procedure TestLog;
end;
/// a custom exception used to show how Delphi exception are handled and
// can be ignored on request
ECustomException = class(Exception);
{$ifdef WITHMORMOT}
TSQLRecordPeople = class(TSQLRecord)
private
fFirstName: RawUTF8;
fLastName: RawUTF8;
fYearOfBirth: integer;
fYearOfDeath: word;
published
property FirstName: RawUTF8 read fFirstName write fFirstName;
property LastName: RawUTF8 read fLastName write fLastName;
property YearOfBirth: integer read fYearOfBirth write fYearOfBirth;
property YearOfDeath: word read fYearOfDeath write fYearOfDeath;
end;
{$else}
// mORMot.pas doesn't compile under Delphi 5 (yet)
TSQLLog = TSynLog;
{$endif}
var
TestLevel: TSynLogInfo = high(TSynLogInfo);
procedure TTestLogClass.TestLog;
var ILog: ISynLog;
S: TSynLogInfos;
begin
ILog := TSQLLog.Enter(self);
// do some stuff
ILog.Log(sllCustom1);
ILog.Log(sllInfo,'TestLevel',TypeInfo(TSynLogInfo),TestLevel,nil);
ILog.Log(sllInfo,'set',TypeInfo(TSynLogInfos),S,nil);
ILog.Log(sllDebug,ILog.Instance);
ILog.Log(sllExceptionOS, 'Some error with stacktrace from %', [ExeVersion.ProgramName], self);
if TestLevel=low(TestLevel) then
TTestLogClass(nil).ClassName; // will raise an access violation
dec(TestLevel);
TestLog;
end;
procedure TestLogProc;
var ILog: ISynLog;
begin
ILog := TSQLLog.Enter;
ILog.Log(sllDebug,'GarbageCollector',GarbageCollector);
ILog.Log(sllDebug,GarbageCollector);
end;
procedure TestsLog;
{$ifdef WITHMORMOT}
procedure TestPeopleProc;
var People: TSQLRecordPeople;
Log: ISynLog;
begin
Log := TSQLLog.Enter;
People := TSQLRecordPeople.Create;
try
People.IDValue := 16;
People.FirstName := 'Louis';
People.LastName := 'Croivebaton';
People.YearOfBirth := 1754;
People.YearOfDeath := 1793;
Log.Log(sllInfo,People);
finally
People.Free;
end;
end;
{$endif}
procedure Proc2(n1, n2: Integer); forward; // test nested
procedure Proc1(n1, n2: Integer);
begin
if n1 = 0 then
try
TTestLogClass(nil).ClassName; // will raise an access violation
except
on E: Exception do
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ recursion test Proc1',e);
end else
Proc2(n1 - 1, n2);
end;
procedure Proc2(n1, n2: Integer);
begin
if n2 = 0 then
try
TTestLogClass(nil).ClassName; // will raise an access violation
except
on E: Exception do
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ recursion test Proc2',e);
end else
Proc1(n1, n2 - 1);
end;
var i: integer;
f: system.TextFile;
info: TSynLogExceptionInfoDynArray;
begin
i := 1; // we need this to circumvent the FPC compiler :)
// first, set the TSQLLog family parameters
with TSQLLog.Family do begin
Level := LOG_VERBOSE;
//Level := [sllException,sllExceptionOS];
//PerThreadLog := true;
//HighResolutionTimeStamp := true;
//AutoFlushTimeOut := 5;
OnArchive := EventArchiveSynLZ;
//OnArchive := EventArchiveZip;
ArchiveAfterDays := 1; // archive after one day
end;
TSQLLog.Add.Log(sllInfo,'Starting');
writeln(' try some low-level common exceptions');
try
dec(i);
if 10 div i=0 then; // will raise EDivByZero
except
on E: exception do
TSQLLog.Add.Log(sllStackTrace,'^^^^^^^^ the first sample, divide by 0',E);
end;
try
closefile(f);
readln(f); // will raise EIOError (no console is available to read from)
except
on E: exception do
TSQLLog.Add.Log(sllStackTrace,'^^^^^^^^ the next sample, I/O error',E);
end;
writeln(' try EAccessViolation in nested procedure calls (see stack trace)');
Proc1(5,7);
Proc2(7,5);
writeln(' try a method recursive call, with an EAccessViolation raised within');
with TTestLogClass.Create do
try
try
TestLog;
except
on Exception do; // just ignore now
end;
finally
Free;
end;
writeln(' try a procedure call with Enter/Auto-Leave');
TestLogProc;
{$ifdef WITHMORMOT}
writeln(' try a procedure call with Enter/Auto-Leave and a TSQLRecordPeople logging');
TestPeopleProc;
{$endif}
writeln(' try a custom Delphi exception');
try
raise ECustomException.Create('Test exception'); // logged to TSQLLog
except
on E: Exception do
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ custom exception type',E);
end;
writeln(' try a custom Delphi exception after been marked as to be ignored');
TSQLLog.Family.ExceptionIgnore.Add(ECustomException);
try
raise ECustomException.Create('Test exception');
except
on E: Exception do
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ nothing should be logged just above',E);
end;
writeln(' try an Exception with message='' - see ticket [388c2768b6]');
try
raise Exception.Create('');
except
on E: Exception do
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ Exception.Message=""',E);
end;
writeln(' try an ESynException');
try
raise ESynException.CreateUTF8('testing %.CreateUTF8',[ESynException]);
except
on E: ESynException do begin
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ ESynException',E);
{$ifdef WITHMORMOT}
TSQLLog.Add.Log(sllDebug,'ObjectToJSONDebug(E) = %',[ObjectToJSONDebug(E)],E);
{$endif}
TSQLLog.Add.Log(sllDebug,'FindLocation(E) = %',[TSynMapFile.FindLocation(E)],E);
end;
end;
{$ifdef MSWINDOWS}
writeln(' try a EOleSysError, as if it was triggered from the .Net CLR');
try
raise EOleSysError.Create('Test',HRESULT($80004003),0);
except
on E: Exception do
TSQLLog.Add.Log(sllInfo,'^^^^^^^^ should be recognized as NullReferenceException',E);
end;
{$endif}
writeln('GetLastExceptions = ');
GetLastExceptions(info);
for i := 0 to high(info) do
writeln(ToText(info[i]));
end;
begin
TestsLog;
writeln('------ finished');
end.

View File

@@ -0,0 +1,66 @@
/// sample program to create .mab files from existing .map files
// - if some .map file name is specified (you can use wild chars), will
// process all those .map files, then create the corresponding .mab files
// - if some .exe/.dll file name is specified (you can use wild chars), will
// process all matching .exe/.dll files with an associated .map file, and will
// create the .mab files, then embedd the .mab content to the .exe/.dll
// - if no file name is specified, will process '*.map' into '*.mab'
// - you can make map2mapb.exe file small if you define LVCL as conditional in
// the Project options and set the ..\lib\LVCL directories as expected
program Map2Mab;
{$APPTYPE CONSOLE}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
SysUtils,
SynCommons,
SynLog;
procedure Process(const FileName: TFileName);
var SR: TSearchRec;
Path, FN: TFileName;
Ext: integer;
AllOk: boolean;
begin
AllOk := True;
Ext := GetFileNameExtIndex(FileName,'map,exe,dll,ocx,bpl');
if (Ext>=0) and (FindFirst(FileName,faAnyFile,SR)=0) then
try
Path := ExtractFilePath(FileName);
repeat
FN := Path+SR.Name;
if (SR.Name[1]<>'.') and (faDirectory and SR.Attr=0) then
try
with TSynMapFile.Create(FN,true) do // true = .map -> .mab
try
if not HasDebugInfo then begin
WriteLn('Error: no Debug Info found on ',FN);
AllOk := False;
end else if (Ext>0) then // has debug info and is not a map
SaveToExe(FN);
finally
Free;
end;
except
on E: Exception do begin // ignore any problem here: just print it and process next file
WriteLn('Error: ', E.ClassName,' ',E.Message);
AllOk := False;
end;
end;
until FindNext(SR)<>0;
finally
FindClose(SR);
end else begin
WriteLn('Error: cant find any file to process matching: ', FileName);
ExitCode := 2;
end;
if not AllOk then
ExitCode := 1;
end;
begin
if paramCount>0 then
Process(paramstr(1)) else
Process('*.map');
end.

View File

@@ -0,0 +1,25 @@
/// library sample code, which makes use of the logging feature
library MyLibrary;
{
In the Project / Options / Linker tab, the Map files option should be set
to detailed, in order to demonstrate how libraries can have their own
symbols file (we need a .map to have this information and create its .mab)
}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
SynCommons,
SynLog;
{$R *.res}
procedure Test;
begin
TSynLog.Family.Level := LOG_VERBOSE;
TSynLog.Enter.Log(sllDebug, 'Called from Test exported procedure');
end;
exports Test;
end.

View File

@@ -0,0 +1,131 @@
object MainForm: TMainForm
Left = 229
Top = 236
BorderStyle = bsDialog
Caption = ' Remote logger'
ClientHeight = 285
ClientWidth = 346
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object grpEvent: TGroupBox
Left = 8
Top = 136
Width = 313
Height = 129
Caption = ' Single Event '
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
ParentFont = False
TabOrder = 0
Visible = False
object cbbEvent: TComboBox
Left = 16
Top = 24
Width = 145
Height = 21
Style = csDropDownList
DropDownCount = 50
ItemHeight = 13
TabOrder = 0
end
object edtText: TEdit
Left = 16
Top = 56
Width = 281
Height = 21
TabOrder = 1
Text = 'Message'
end
object btnEventSend: TButton
Left = 16
Top = 88
Width = 75
Height = 25
Caption = 'Send'
TabOrder = 2
OnClick = btnEventSendClick
end
object btnDisconnect: TButton
Left = 222
Top = 88
Width = 75
Height = 25
Caption = 'Disconnect'
TabOrder = 3
OnClick = btnDisconnectClick
end
end
object grpConnection: TGroupBox
Left = 8
Top = 16
Width = 321
Height = 105
Caption = ' Connection To the LogView Server'
TabOrder = 1
object lblServer: TLabel
Left = 8
Top = 27
Width = 78
Height = 13
Alignment = taRightJustify
Caption = 'Server Address:'
end
object lblPort: TLabel
Left = 27
Top = 51
Width = 59
Height = 13
Alignment = taRightJustify
Caption = 'Server Port:'
end
object lblInfoConnect: TLabel
Left = 16
Top = 80
Width = 269
Height = 13
Caption = 'Please ensure that the LogView tool is running as server'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = [fsItalic]
ParentFont = False
end
object edtServer: TEdit
Left = 88
Top = 24
Width = 121
Height = 21
TabOrder = 1
Text = '127.0.0.1'
end
object edtPort: TEdit
Left = 88
Top = 48
Width = 121
Height = 21
TabOrder = 2
Text = '8091'
end
object btnConnect: TButton
Left = 222
Top = 40
Width = 75
Height = 33
Caption = 'Connect'
TabOrder = 0
OnClick = btnConnectClick
end
end
end

View File

@@ -0,0 +1,88 @@
unit RemoteLogMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, SynCommons, SynLog, mORMot, mORMotHttpClient;
type
TMainForm = class(TForm)
grpEvent: TGroupBox;
cbbEvent: TComboBox;
edtText: TEdit;
btnEventSend: TButton;
grpConnection: TGroupBox;
edtServer: TEdit;
lblServer: TLabel;
lblPort: TLabel;
edtPort: TEdit;
lblInfoConnect: TLabel;
btnConnect: TButton;
btnDisconnect: TButton;
procedure btnConnectClick(Sender: TObject);
procedure btnEventSendClick(Sender: TObject);
procedure btnDisconnectClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
fNumber: integer;
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R vista.RES} // includes Win10 manifest - use .RES for linux cross-compilation
{$R *.dfm}
procedure TMainForm.FormCreate(Sender: TObject);
begin
PTypeInfo(TypeInfo(TSynLogInfo))^.EnumBaseType^.AddCaptionStrings(cbbEvent.Items);
SQLite3Log.Family.Level := LOG_VERBOSE;
end;
procedure TMainForm.btnConnectClick(Sender: TObject);
begin
try
Screen.Cursor := crHourGlass;
try
TSQLHttpClient.CreateForRemoteLogging(
AnsiString(edtServer.Text),SQLite3Log,StrToInt(edtPort.Text));
finally
Screen.Cursor := crDefault;
end;
except
on E: Exception do begin
MessageDlg(E.Message,mtError,[mbOk],0);
exit;
end;
end;
grpConnection.Enabled := false;
btnConnect.Enabled := false;
cbbEvent.ItemIndex := Ord(sllInfo);
grpEvent.Show;
btnEventSend.SetFocus;
end;
procedure TMainForm.btnEventSendClick(Sender: TObject);
begin
SQLite3Log.Add.Log(TSynLogInfo(cbbEvent.ItemIndex),
FormatUTF8('% - %',[edtText.Text,fNumber]));
inc(fNumber);
end;
procedure TMainForm.btnDisconnectClick(Sender: TObject);
begin
SQLite3Log.Family.EchoRemoteStop;
grpConnection.Enabled := true;
btnConnect.Enabled := true;
cbbEvent.ItemIndex := Ord(sllInfo);
grpEvent.Hide;
btnConnect.SetFocus;
end;
end.

View File

@@ -0,0 +1,14 @@
program RemoteLoggingTest;
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
Forms,
RemoteLogMain in 'RemoteLogMain.pas' {MainForm};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

View File

@@ -0,0 +1,45 @@
/// sample program able to uncompres .log.synlz archived files into visualizable
// .log files as created by TSynLog
// - if some .synlz file name or wildchar pattern is specified as command line
// parameter, it will process all matching files
// - if no file name nor pattern is specified in the command line, will search
// for '*.synlz' in the current folder
// - uncompression will be stored in the same directory as the original .synlz
// - you can make unsynlz.exe file small if you define LVCL as conditional in
// the Project options and set the ..\lib\LVCL directories as expected
program UnSynLz;
{$APPTYPE CONSOLE}
uses
{$I SynDprUses.inc} // use FastMM4 on older Delphi, or set FPC threads
SysUtils,
SynCommons,
SynLog;
procedure Process(const FileName: TFileName);
var SR: TSearchRec;
Path: TFileName;
begin
if (GetFileNameExtIndex(FileName,'synlz')=0) and
(FindFirst(FileName,faAnyFile,SR)=0) then
try
Path := ExtractFilePath(FileName);
repeat
if (SR.Name[1]='.') or (faDirectory and SR.Attr<>0) then
Continue;
write(SR.Name);
if FileUnSynLZ(Path+SR.Name,Path+copy(SR.Name,1,length(SR.Name)-6),LOG_MAGIC) then
writeln(' OK') else
writeln(' Error');
until FindNext(SR)<>0;
finally
FindClose(SR);
end;
end;
begin
if paramCount>0 then
Process(paramstr(1)) else
Process('*.synlz');
end.

View File

@@ -0,0 +1,70 @@
// test logging when 6000 threads are created (per chunks of 20)
program thread512;
{$APPTYPE CONSOLE}
uses
{$ifdef MSWINDOWS}
Windows,
{$endif}
SynCommons,
SynLog,
mORMot,
Classes,
SysUtils;
type
TMyThread = class(TThread)
protected
procedure Execute; override;
end;
var
n: integer;
procedure SubProc;
begin
InterlockedIncrement(n);
TSynLog.Enter(nil,'SubProc').Log(sllDebug,'Thread #% (%)',[n,pointer(GetCurrentThreadID)]);
sleep(0);
end;
procedure TMyThread.Execute;
var n: TThreadID;
log: TSynLog;
begin
n := GetCurrentThreadId;
log := TSynLog.Add;
log.Log(sllTrace,'Entering thread %',[pointer(n)]);
SubProc;
log.Log(sllTrace,'Leaving thread %',[pointer(n)]);
log.NotifyThreadEnded;
end;
procedure Test;
var i,j: Integer;
t: array[1..20] of TMyThread;
begin
TSynLog.Enter;
for i := 1 to 300 do begin
for j := Low(t) to high(t) do
t[j] := TMyThread.Create(false);
for j := high(t) downto low(t) do
t[j].WaitFor;
for j := Low(t) to high(t) do
t[j].Free;
end;
end;
var Timer: TPrecisionTimer;
begin
TSynLog.Family.Level := LOG_VERBOSE;
TSynLog.Family.PerThreadLog := ptIdentifiedInOnFile;
TSynLog.Family.EchoToConsole := LOG_STACKTRACE;
Timer.Start;
Test;
writeln(n,' threads created in ',Timer.Stop);
{$ifdef MSWINDOWS}
readln;
{$endif}
end.