Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7160917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:28:39+00:00 2026-05-28T13:28:39+00:00

I made a dead simple Console class in AS3 that allows logging to be

  • 0

I made a dead simple Console class in AS3 that allows logging to be turned on or off with a boolean switch on the class. When the boolean is set to false, all the calls to Console.log("message") do nothing instead of trace("message").

(I know there are frameworks available for AS3 logging – this was a quick, lightweight fix for me in this context.)

It saves me having to comment out or remove the multitude of Console messages before going to production, but means there are hundreds or thousands of calls to an empty function happening when this runs.

I haven’t seen any problems yet with this approach – the performance hit seems to be negligible – but am I missing anything? Are there any gotchas to be aware of when calling empty functions over and over again?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:28:40+00:00Added an answer on May 28, 2026 at 1:28 pm

    If the performance isn’t suffering there’s nothing wrong with that. I similarly use NullLoggers which have empty methods for logging. See Null Object Pattern

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a class that derives from Component: public class MyComponent: System.ComponentModel.Component { }
I've recently made a decompiler for AVM2/AS3, and I've noticed that Flash compiler tends
I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework
I made a code that translate strings to match each word from the array
I made a UIView using Interface Builder with a top bar that has Cancel
I'm currently working with a dead network application that received packets for a chat.
i want to launch ffmpeg from my app and retrive all console output that
In a application that I made, server accepts socket connection from clients and do
I'm trying to set up logging with Microsoft's Enterprise Library (log4net seems to be
I made a website that depends on PHP, AJAX and Javascript. The problem here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.