Jump to content

Recommended Posts

Posted (edited)

Hello guys.  It's been awhile since I shared something. So today I want to share my last project.

What's Loga?

Loga is a simple logging library to keep track of code with an integrated console.

Features.

  • Common log levels.
  • Integrated console.
  • Multiple instances.
  • Custom color and font for each instance log level.
  • Define output format with macros.
  • Conditional and occasional Logging.
  • Easy to use.

Basic Usage:

#include "..\Loga.au3"


;This are some of the default settings:
;Default log level $LOGA_LEVEL_TRACE
;output format: {Symbol}{LogIndex} {LevelName} {LongDateTime} {Message}
;Log to File is enabled.
;Log file name format: YYYYMMDDHHMM-Loga-InstanceIndex.log
;Custom Console is disabled by default.
;By default log to STDOUT.

_LogaTrace("I'm Trace")
_LogaDebug("I'm Debug")
_LogaInfo("I'm Info")
_LogaWarn("I'm Warn")
_LogaError("I'm Error")
_LogaFatal("I'm Fatal")

 

More examples here.

 

Check Loga on GitHub.

 

Loga Latest Release v1.0.2.

 

Saludos

 

 

 

 

Edited by Danyfirex
Update
Posted (edited)

Few feature request:

1.

_LogaTrace("I'm Trace")
_LogaDebug("I'm Debug")
_LogaInfo("I'm Info")
SetError(10,20)
_LogaWarn("I'm Warn")
_LogaError("I'm Error")
_LogaFatal("I'm Fatal")

function should log @error and @extended 

2.

_LogaTrace("I'm Trace")
_LogaDebug("I'm Debug")
_LogaInfo("I'm Info")
SetError(10,20)
_LogaWarn("I'm Warn")
If @error Then MsgBox($MB_ICONERROR, 'TEST', '@error = ' & @error & @CRLF & '@extended = ' & @extended)
_LogaError("I'm Error")
_LogaFatal("I'm Fatal")

Function should be transparent for @error and @extended

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
Posted

If last function return @error or @extended 

_LastFunction() ; SetError(10,20)
_LogaWarn("I'm Warn")
If @error Then MsgBox($MB_ICONERROR, 'TEST', '@error = ' & @error & @CRLF & '@extended = ' & @extended)


Then _Loga* function should store this values report them to log and restore on exit.

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

btw I really like your "09 - Custom GUI Console Color And Font .au3"

I must look closer to your solution and check it how you create this colors on this output.
I have similar solution in my "FRAMEWORK" for all of my projects, but I've never started to implement coloring - which was always on my TODO list.

 

image.png.45a0bce61cb596bf45cd764a1f0054f1.png

 

image.png.1bacb1b4f7c2ce6dad8c89c6d00097a6.png

 

EDIT: and I must to check how you use different font size - very interesting solution

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Understood. It will be added as song as possible.

 

Saludos

Posted

and one remarks

Please try to not use Local keyword in global scope - in your examples .. as this is not good practices, and fires many Warrnings by Au3Check in console.

  Quote

"C:\Users\Szef\Downloads\Loga-1.0.0\Loga-1.0.0\Examples\09 - Custom GUI Console Color And Font.au3"(4,7) : warning: 'Local' specifier in global scope.
Local $sSettings1
~~~~~~^
"C:\Users\Szef\Downloads\Loga-1.0.0\Loga-1.0.0\Examples\09 - Custom GUI Console Color And Font.au3"(8,7) : warning: 'Local' specifier in global scope.
Local $hLoga1
~~~~~~^
"C:\Users\Szef\Downloads\Loga-1.0.0\Loga-1.0.0\Examples\09 - Custom GUI Console Color And Font.au3"(17,7) : warning: 'Local' specifier in global scope.
Local $sSettings2
~~~~~~^
"C:\Users\Szef\Downloads\Loga-1.0.0\Loga-1.0.0\Examples\09 - Custom GUI Console Color And Font.au3"(22,7) : warning: 'Local' specifier in global scope.
Local $hLoga2
~~~~~~^
C:\Users\Szef\Downloads\Loga-1.0.0\Loga-1.0.0\Examples\09 - Custom GUI Console Color And Font.au3 - 0 error(s), 4 warning(s)
->15:40:29 AU3Check ended. Press F4 to jump to next error.rc:1
 

Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

@Earthshine You may be right. So consider take a look of all examples.

 

Saludos

Posted

@Earthshine You may be right. So consider take a look of all examples.

 

Saludos

Posted (edited)
  On 9/26/2018 at 1:34 PM, Danyfirex said:

Understood. It will be added as soon as possible.

Expand  

take a look here:

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
Posted

Using:

#include "..\Loga.au3"
SetError(1,2)
_LogaTrace("I'm Trace")
_LogaDebug("I'm Debug")
_LogaInfo("I'm Info")
_LogaWarn("I'm Warn")
_LogaError("I'm Error")
_LogaFatal("I'm Fatal")
If @error Then MsgBox($MB_ICONERROR, 'TEST', '@error = ' & @error & @CRLF & '@extended = ' & @extended)

I get MsgBox but  in console I get:

  Quote

>0000000001 [Trace] 28\09\2018 13:37:18 I'm Trace
>0000000002 [Debug] 28\09\2018 13:37:18 I'm Debug
+0000000003 [Info]  28\09\2018 13:37:18 I'm Info
-0000000004 [Warn]  28\09\2018 13:37:18 I'm Warn
!0000000005 [Error] 28\09\2018 13:37:18 I'm Error
!0000000006 [Fatal] 28\09\2018 13:37:18 I'm Fatal

Expand  

Do you plan to implement reporting to log about @error and @extended ?

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

I'll add a setting to enable/disable that feature for the next release. 

 

Saludos

  • 3 weeks later...
Posted

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 years later...
Posted

Nice little logging tool here, I quite like it, specifically the GUI Console.

Does there happen to be a list of all possible options/settings that one can set for this logging tool? I quite like it and have started using it bug struggling to find all the options, sifting directly through the code and coming up with a few of them from there + the examples but a list would be nice.

With that said, is there a way to enable WordWrap on the GUI Logging Console?

Posted

Hello @Sylice 

I think All possible settings are the ones you see in the examples. I'll try to Add some list later as a documentation.

I'm not sure about the feature word-wrap You're looking for... Could you explain more about it?

 

Saludos

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...