Skip to main content

Brainstorming package to manage logs in txt file

Project description

pybraflog Readme 📜

Brainstorming package to manage logs in txt file

Installation ⚡

Opérating system : Windows, MacOS & Linux :

Available function/class 📑

to create => FileUtils(afilename, adeffolder)

adeffolder : folder to write file. if not exist or empty error.
afilename  : the file name to write.

to open log => openlog

Open the log file.

to write info in log => writeLog(alog, anbrident)

alog : a line to add in file log. wothout add \n at the end to CRLF.
anbrident : to define indentation, number of space to add before alog, by default 0.

to clear log => clearoldlog(aretentionday)

to erase all log old than aretentionday, by default 15 days(optional).
You need to do when the filelog is open.

to close log => closelog()

Close the log file.

class log, this class is use to transfert txt log for function to parant function

value : for log in one line.
valuelst : for log in more lines.

Howto use 📰

import os
import pybraflog
import pybrafile

flog = pybraflog.FileLog('testlog.txt', '')
if flog.iserror:
    print(flog.error)

flog = pybraflog.FileLog('testlog.txt', os.getcwd())    
flog.openlog()

flog.writeLog('first line')
flog.writeLog('first line indent', 10)
flog.writeLog('two line')

flog.closelog()

file = pybrafile.FileUtils('testlog.txt')
file.openfile('r')
txt = file.readfile()
file.close()

print(txt)
print(pybraflog.version())

Meta 💬

Brainstorming – Support.erp@brainstorming.eu

Distributed under the MIT license. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybraflog-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybraflog-0.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pybraflog-0.1.1.tar.gz.

File metadata

  • Download URL: pybraflog-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for pybraflog-0.1.1.tar.gz
Algorithm Hash digest
SHA256 752d11ed00ec855bba2e6085e8428ed1070805fd2a4d3df5bf964c94df5b8d84
MD5 836315c7e0deb28b6236f09cc37d721f
BLAKE2b-256 3f7d40aeb20a022fb465f9235861f8f8504477d07e19d1389be355acaf01ce09

See more details on using hashes here.

File details

Details for the file pybraflog-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pybraflog-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.11 Windows/10

File hashes

Hashes for pybraflog-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8c96095b7191ce7f6bec5ff2c216c6dc2218525a78c38727d58f5952b7a468
MD5 2e5a14e2cba54c3b832feadea2e65396
BLAKE2b-256 f369dcdecc29e3e5667860b8de9c9664d23380fa43dd19561d161e25415ee1ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page