Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [logging]

Computer data logging is the process of recording events in a computer program, usually with a certain scope, in order to provide an audit trail that can be used to understand the activity of the system and to diagnose problems.

Filter by
Sorted by
Tagged with
3 votes
1 answer
236 views

Logging in a different thread using circular buffer C++

What it does The code creates a logger class which instantiates a circular buffer at construction and uses producer-consumer style approach using condition_variable to log and print the messages to ...
wwite's user avatar
  • 33
0 votes
1 answer
62 views

Manage repetitive/similar structures (logging & try/catch blocks)

I'm writing a web bot using puppeteer and I'm logging (using winston) every action the bots does and running it inside try/catch blocks. For automating these processes and avoid code repetition I ...
lapdoggo's user avatar
3 votes
1 answer
126 views

utility to manipulate java.util.logging config using command-line system properties

This is intended for temporary ad-hoc changes to logging config, for example when debugging etc. Also included are functions to easily manipulate config from a code (for example at the beginning of a ...
morgwai's user avatar
  • 401
4 votes
2 answers
162 views

Header only logging library in C++

Source Code I've attempted to create a simple logging library in cpp. My goal was to make it lightweight to incorporate and easy to add to the codebase. ...
Saphereye's user avatar
  • 233
1 vote
1 answer
88 views

A Windows localhost key logger in C++ with WinAPI

Now I have this repository. It's a key logger logging all the keyboard events possible. Note that some programs do not "leak" the keyboard events outside of their GUI. For example, Notepad++ ...
coderodde's user avatar
  • 28.5k
3 votes
1 answer
48 views

Logger with a Core and Client side

This logger is for a game engine I'm writing it has a core side which is the game itself and a client side which is the engine. The architecture of the code I feel like is messy it has the main log ...
rrandel's user avatar
  • 55
2 votes
1 answer
126 views

Logger for a Game Engine

So I'm making a logger for a program and it has 6 levels increasing severity and things I don't think its as memory efficient as it could be but I'm just getting into c++ and memory coding. I feel ...
rrandel's user avatar
  • 55
1 vote
0 answers
45 views

Go log file swapper

Please review my code. I left some comments where I think something might be wrong, but any comment is appreciated. I am writing a package for a project I am currently building. Its purpose is simply ...
Daniel Burgos's user avatar
3 votes
1 answer
80 views

Logging activity traces with custom APIs

I've got this idea (based on experience) that logging plain messages isn't just enough to monitor an application so I built an abstraction layer on top of the built-in ...
t3chb0t's user avatar
  • 44.3k
3 votes
1 answer
224 views

Custom single-header C++ logging library

I started learning C++ recently for game development, and decided to write my own little library for debugging. Here is the library (snoop.hpp) ...
Marc's user avatar
  • 33
4 votes
1 answer
89 views

Generic logging setup that enables context information

I use the below code to include context specific information in logging record (see obj). ...
user avatar
1 vote
1 answer
779 views

Replacement for EnsureSuccessStatusCode

I like the simplicity of EnsureSuccessStatusCode for HttpResponseMessage after a call using ...
Vaccano's user avatar
  • 317
1 vote
2 answers
325 views

Logger using variadic macros

I'm getting back into C and I wrote this variadic logger as part of a chess application I'm writing. As such I'm looking for feedback about the general approach (I'm going to give it another pass to ...
blinken_lx's user avatar
3 votes
1 answer
873 views

A Python decorator to trace function calls

A while ago, I came up with a function that is similar to this one: Decorator to log function calls and return values, but with a different implementation. What this function does: when applied to a ...
Kate's user avatar
  • 6,823
2 votes
0 answers
307 views

Decorator to log function calls and return values

I want to write a decorator in Python 3.11 that adds some basic logging to functions. I want to use the decorator without any keyword arguments: @add_logging In ...
uli's user avatar
  • 21
2 votes
2 answers
117 views

Python Logger Implementation

I have developed an implementation of a logger in Python. I know that Python already has a built-in logger, my goal with this is to get feedback and suggestions for improvement, particularly about ...
nabla-f's user avatar
  • 163
3 votes
1 answer
61 views

Cancelling function execution with a ContinuationError

Although throwing excptions for control flow is a controversial topic there are some quite popular examples of using this anti-pattern like C#'s async routines throwing the ...
t3chb0t's user avatar
  • 44.3k
3 votes
0 answers
235 views

System to automatically login to my university's Wi-Fi network using HTTP request

What is this? My university's Wi-Fi network requires students to visit a specific URL and login to the network before we can use the actual internet. This project replicates that same process by ...
eccentricOrange's user avatar
1 vote
1 answer
47 views

Python colorized debug printer

In Python you can use print(locals()) to print a dictionary of all the local variables, but this has 3 shortcomings: Double underscore variables will be included ...
Caridorc's user avatar
  • 27.5k
2 votes
1 answer
989 views

Serilog logging extension methods

I've been using this extension in almost all of my projects. What's your opinion? Do you think there is something else to add or to be improved? The idea is to ignore all default ASP.NET messages that ...
nop's user avatar
  • 729
10 votes
3 answers
3k views

C++ code for a simple single header logging library

I have been working out on C++ code lately just for fun and decided to make a simple logger in it. The code works fine, but it would be great if someone more knowledgeable could point out any mistakes/...
Acedev003's user avatar
  • 111
4 votes
2 answers
1k views

Logger that writes to text file with std::vformat

This class has a Log function that appends text to a log text file. It takes a format string and a variable amount of arguments, much like a ...
vince.smdt's user avatar
7 votes
2 answers
1k views

Implicitly logging the filepath of the callsite of the log-statement

Today I was challenged to build atop Python's logging module to automatically log the filepath from whence the log statement was ...
P i's user avatar
  • 629
5 votes
0 answers
57 views

Message-free flow-oriented logger

Today, I've got a small FlowLogger for you to review. The idea is not to log pure messages, but focus on the flow of the app that might contain such items as: <...
t3chb0t's user avatar
  • 44.3k
1 vote
2 answers
579 views

Find the newest file that contains a specific string in every subdirectory of the path using the least resources

I have a server side logs folder that contains many hundreds of logs most of which are in subdirectories according to the machine the logs have come from. The task is to extract the full path of the ...
Richard Payne's user avatar
4 votes
0 answers
114 views

Injectable EventLogger for custom application events that are handled differently from normal logs

I am trying to become better at designing classes for dependency injection and IOC in general. It is often not an intuitive concept. I have the following python interface and implementation for a ...
Patrick Christie's user avatar
1 vote
1 answer
319 views

I have written a method to write any string in file. Should I close file or not

I have written this code to write string to file. If File is not created then create file and If created append to same file. File is created daywise. ...
Sup Ravi Kumar's user avatar
2 votes
2 answers
5k views

A simple logging library in C

I've created a simple logging library in C which I can use in my other projects. I wanted to get started in software development using the C language, and this is my first attempt at writing something ...
Vedant Jadhav's user avatar
0 votes
2 answers
149 views

Program for monitoring file in Combined Log Format

After encountering a suggestion that monitoring a log file for a webserver could allow for the implementation of automatically analyzing and handling of certain events (that might require altering ...
Noctis Skytower's user avatar
1 vote
1 answer
401 views

Low-Latency Multithreaded Logger

My goal was to have a logger that does the blocking file I/O in a separate thread. A few notes: I made it a singleton rather than having a global "logger" variable, or a bunch of loggers ...
CaptainCodeman's user avatar
10 votes
1 answer
2k views

Python script to analyse Apache log files

I am fairly new to Python programming language. Most of python programmers have heard the philosophy behind the python programming language. The code should be easy to read, easy to understand, simple,...
dovexz12323's user avatar
2 votes
0 answers
140 views

C++ logger for Windows

I have written a simple logger in C++ on Windows that I want to use to log info and errors from multiple threads to DbgView: ...
Andy's user avatar
  • 255
3 votes
1 answer
347 views

EFCore Monitor Interceptor with logging queries

I created a SqlMonitorInterceptor that will check the execution time of queries and log errors. The main idea is to log queries in such a way that they can be easily copied into SQL Server Management ...
sDima's user avatar
  • 849
0 votes
1 answer
452 views

Go logging wrapper that adds log levels

The package is essentially a small wrapper around the stdlib logger that provides a very simple, easy to use logger that can toggle between different log levels (DEBUG, INFO, WARNING, ERROR). Log ...
CageFury's user avatar
-2 votes
1 answer
130 views

Write portable Git aliases

The following aliases return all the same number of results, on my Cygwin (on Windows): ...
user3341592's user avatar
2 votes
3 answers
2k views

C++ logger by template

If the log file is not available, then output the log message to the console. Any improvement or suggestion for this implementation for the logger by the template? Any potiencial problem that I should ...
John's user avatar
  • 405
4 votes
1 answer
121 views

Improvements to logger and how to correctly use it

I am working on a project, neurodecode, which uses a logger based on the logging library. As I am not very familiar with logging, I don't know how to further ...
Mathieu's user avatar
  • 211
4 votes
2 answers
342 views

Linux backup script written in bash for tar

This is my first attempt at scripting with bash. I am running Ubuntu server, so I don't get to use all the gui back ups out there. Besides, tar works fine for personal use. Please let me know of any ...
Riv's user avatar
  • 195
2 votes
3 answers
283 views

Java logger (of doom!), updated

In a previous question, Java logger (of doom!), I had posted my own logger, written in Java. I have since taken the answers from that question and a few of my own things to update it. New code: ...
CATboardBETA's user avatar
2 votes
3 answers
116 views

Java logger (of doom!)

I wrote my own logger, but I dislike how many times I overloaded the log() function. If anyone knows of another way of doing that, feel free to share. ...
CATboardBETA's user avatar
4 votes
2 answers
689 views

Multithreaded logger

I made a multithreaded logger years ago when I was still a total newbie. It "worked" (when it didn't deadlock). Now that I'm slightly less newbie I'd like to get some criticism on this new ...
Barnack's user avatar
  • 217
5 votes
3 answers
290 views

Class showing a format similar to var_dump RC5 Version

Some methods of this library require some improvements (see this description): In the constructor I am trying to create the possibility that the user modifies the ...
user avatar
1 vote
2 answers
2k views

cout style logger in C++

Please review my ostream logger, ologger, which attempts to make logging as easy as using cout. The ostream operator<< is leveraged so that anything that can be logged to cout can be logged to ...
arcomber's user avatar
  • 2,449
5 votes
0 answers
1k views

Reading sensor data from serial device and publishing on MQTT

I have a weather station with a data logger which accepts commands (specified in user manual) and sends back the respective data over a serial interface. In my case, I want to read the current data ...
wuff1337's user avatar
1 vote
1 answer
51 views

Logging conditionally repetitively in code

I am using Log4j2 for logging. Multiple operations return success code. If status 0 is received, it means operation is successful, else failed. If operation is ...
Gaurav Jeswani's user avatar
6 votes
2 answers
624 views

Error Code Stack Trace and Propagation Library in C

I've been programming in Go and I enjoy how easy it is to create descriptive errors and propagate them up the call stack. I wanted that sort of ease and consistency in C so I created a small error ...
Ollie's user avatar
  • 163
13 votes
3 answers
2k views

Logger module in C

I wrote a logger module in C, that is essentially a printf wrapper + some additional color coding: I'd like get feedback how I can improve performance and also use better coding style. Right now, I ...
766F6964's user avatar
  • 901
3 votes
2 answers
250 views

Java Logging with a file per root package

I have a set of classes across multiple packages, and I want any logging from within a single "com.name.root.xxx" package and all its child packages, to be logged to a different file. e.g: <...
simonalexander2005's user avatar
4 votes
1 answer
3k views

Simple Logger in C++

I'm currently making a game using C++. I eventually needed a logger, but I wasn't satisfied with any of the existing solutions. After a while, I wrote my own header called log.h: ...
coolmouse21's user avatar
3 votes
3 answers
421 views

C Logging Function

I wrote this log function and it works but is there a better way to write into the file stream and console at the same time? ...
cynnad's user avatar
  • 79

1
2 3 4 5
7