Skip to main content

CndPrint

CndPrint is a simple and elegant log display library. It allow you from one place to display more or less log message.

>>>> import cndprint
>>>> cnd_print = CndPrint()
>>>> cnd_print.log_e("Hello")
25/07/2022 22:59:54#|#Hello

instanciate the class

uuid

UUID will be display in beginning of each log message (after date). It can allow you to identify a unique run ID (very usefull if you use a log agregator)

level

Switch to log, info or trace to display more or less message

silent mode

use this for example in automated testing mode, when you don't need any message

Multiple event familly with color

You can use 5 event familly :

  • e : Usually use for Error (red)
  • s : Any Success event (green)
  • d : Use when i decide to go Down into a method(blue)
  • c : Use when you Call another method (cyan)
  • v : use for warning of simply Verbose (yellow)

Some exemple :

>>>> import cndprint
>>>> cnd_print = CndPrint()
cnd_print.log_e("You failed ! that's not good !")
cnd_print.log_s("You got it baby !")
cnd_print.log_d("Start looping into for")
cnd_print.log_c("Now calling sub method")
cnd_print.log_v("what the waether today ?")

Multiple level for printing

You can define 3 level for log filtering : 'trace', 'log', 'info'

trace error can be identify with trace_ trace display trace, log and info log display log and info info display only info

By default Info is actif, to use another level simplye use this

level=log (default)

import cndprint
cnd_print = CndPrint()
cnd_print.log_e("Hello Log")
cnd_print.info_e("Hello Info")
cnd_print.trace_e("Hello Trace")

will result in this

25/07/2022 22:59:54#|#Hello Log

level=info

But the same code, if you just replace

import cndprint
cnd_print = CndPrint(level='info')
cnd_print.log_e("Hello Log")
cnd_print.info_e("Hello Info")
cnd_print.trace_e("Hello Trace")

the print is now

25/07/2022 22:59:54#|#Hello Log
25/07/2022 22:59:54#|#Hello Info

level=trace

But the same code, if you just replace

import cndprint
cnd_print = CndPrint(level='trace')
cnd_print.log_e("Hello Log")
cnd_print.info_e("Hello Info")
cnd_print.trace_e("Hello Trace")

the print is now

25/07/2022 22:59:54#|#Hello Log
25/07/2022 22:59:54#|#Hello Info
25/07/2022 22:59:54#|#Hello Trace

Metadata

Release files for cndprint 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cndprint 0.1.2
File Size Uploaded
cndprint-0.1.2.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cndprint 0.1.2
File Interpreter ABI Platform
cndprint-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / cndprint-0.1.2.tar.gz

Download URL cndprint-0.1.2.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c378cc04638daddc7ad83ddd1bb40fd727b813ffbdd4f159d2739179c32b5a68
BLAKE2b-256 checksum
How to use checksums
e0532d280acb582c30fe2b4e119dde600bc85a98d18a2e3b3ea563f89c4aabb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release files / cndprint-0.1.2-py3-none-any.whl

Download URL cndprint-0.1.2-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21f3def5fc638546430d7e7854763a69a8cf3f40a9bf6c2c7f101b0ea75ff909
BLAKE2b-256 checksum
How to use checksums
31529ba5aa8d64745fedd7eeda96e993c1e55aa798aafc8ff606992d60a7313c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page