Package: signalepy
Signale.pyElegant Console Logger For Python Command-Line AppsInstallationSignale.pycan be installed using pip.[sudo]pipinstallsignalepyUsagePackage consists of a classSignale, it is the main constructor class. The object created has all the logger functions in it.Using LoggersEach logger function takes in three arguments:-textprefix( Optional )suffix( Optional )They all are available in the logger object. To create one do this:-fromsignalepyimportSignalelogger=Signale()Now you can use the default loggers using this object like:-...logger.success("Started Successfully",prefix="Debugger")logger.warning("`a` function is deprecated",suffix="main.py")logger.complete("Run Complete")...This will produce the following result:-View All Available LoggerssimplesuccesserrorwarningstartstopwatchimportantpendingcompletedebugpauseinfolikecenterboldunderlinereversedcolouredScoped LoggersTo create scoped loggers, define thescopefield in theoptionsargument of constructor like:-fromsignalepyimportSignalelogger=Signale({"scope":"global scope"})logger.success("Scoped Logger Works!")This will produce the following result:-You also create multiple scopes by setting thescopefield to a list of strings like:-fromsignalepyimportSignalelogger=Signale({"scope":["global scope","inner scope"]})logger.success("Scoped Logger Works!")This will produce the following result:-You can also create scoped a logger which is just clone of other by using by using thescopedfunction like this:-fromsignalepyimportSignalelogger=Signale({"scope":"global scope"})logger2=logger.scoped("inner")logger2.like("I love Signale.py",prefix="Shardul Nalegave",suffix="Creator")This will produce the following result:-Note:-All the configuration will be copied to the new logger just the scope will be extended.Custom LoggersCustom loggers can be created by passing a array of custom logger configuration to the fieldcustomin the options passed to the constructor. Even clone loggers inherit the parent's custom loggers. For example:-fromsignalepyimportSignalelogger=Signale({"scope":"global scope","custom":[{"badge":"!","label":"Attention","color":"red","name":"attention"}]})logger2=logger.scoped("inner")logger.attention("It Works!")logger2.attention("With Logger2")This will produce the following result:-Underlined LabelsYou can set labels to be underlined by setting theunderlinedfield toTruein the options passed to the constructor. For example:-fromsignalepyimportSignales=Signale({"underlined":True})s.center("Testing Logger")s.simple("ABC",prefix="Debugger",suffix="xyz")s.info("Starting",prefix="Debugger")s.success("Started Successfully",prefix="Debugger",suffix="xyz")s.watch("Watching All Files",prefix="Debugger")s.error("Something Went Wrong",prefix="Debugger")s.warning("Deprecation Warning",prefix="Debugger")s.pending("Postponed",prefix="Debugger")s.debug("Found A Bug on L55",prefix="Debugger")s.start("Started New Process",prefix="Debugger")s.pause("Process Paused",prefix="Debugger")s.complete("Task Completed",prefix="Debugger")s.important("New Update Available. Please Update!",prefix="Debugger")s.like("I Love Signale",prefix="Debugger")s.stop("Stopping",prefix="Debugger")This will produce the following result:-OptionsOptions taken by constructorscopeType:strorlistSignale Logger ScopeunderlinedType:boolLabels Should Be Underlined Or NotcustomType:listList of custom logger configuration.Configuration Type:dictCustom Logger Configuration DictionaryKeysnameType:strName of the loggerlabelType:strLabel displayed beside the icon ( colored text )badgeType:strIconcolorType:strColor of the icon and label. Should be from:-reddarkbluepinkgreengreypurpleyellowcyanreset(color reset code)APIlogger =Signale(<options>)SignaleType:classSignale class imported fromsignalepymoduleoptionsType:dictOptions Dictionary for logger.Returns: Signale Logger ObjectLogger object which can be used for logginglogger.<logger>(message="", prefix="", suffix="")loggerType:functionCan be any default loggermessageType:strMessage to be displayedprefixType:strRequired: FalsePrefix textsuffixType:strRequired: FalseSuffix textReturns:Nonelogger2 =logger.scoped(<new scope>)loggerType: Signale Logger ObjectParent Loggernew scopeType:strNew Scope NameReturns: Signale Logger ObjectClone Logger object with extended scopeLicensed UnderMIT LicenseA Project ByShardul Nalegave